Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Enable auto EOL on git repo side, fix some character encoding issues#4912

Merged
daxian-dbw merged 7 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:file-cleanupSteveL-MSFT/PowerShell:file-cleanupCopy head branch name to clipboard
Sep 25, 2017
Merged

Enable auto EOL on git repo side, fix some character encoding issues#4912
daxian-dbw merged 7 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
SteveL-MSFT:file-cleanupSteveL-MSFT/PowerShell:file-cleanupCopy head branch name to clipboard

Conversation

@SteveL-MSFT

Copy link
Copy Markdown
Member

Some of the cleanup work from #4761

  • add ending newline to files missing it
  • update .gitattributes to enforce autocrlf on all text files (this means some of the files show broader changes because it had CRLF on the repo side, but should just be LF)
  • added missing opening element
  • fix mis-encoded character to apostrophe
  • fix copyright symbol where it didn't show up correctly in vscode (although it shows up fine here, it's using the unicode symbol instead of the extended ascii one)

cc @mklement0 @markekraus

@markekraus

Copy link
Copy Markdown
Contributor

Just to state the obvious, but, the hashes in the tests will need to be updated for the files which were modified.

updated file hashes in the test
@SteveL-MSFT SteveL-MSFT force-pushed the file-cleanup branch 3 times, most recently from 0fc3fd6 to 08c4e00 Compare September 25, 2017 03:07
@SteveL-MSFT

SteveL-MSFT commented Sep 25, 2017

Copy link
Copy Markdown
Member Author

Not sure why the FileCatalog test is failing on AppVeyor. Passing on my WS2016 and WS2012R2 boxes.

Figured it out, resaving it locally with just LF EOL I get the same hash as on AppVeyor. So I'm resaving the test file as LF so it should be consistent everywhere.

updated testfile hash due to change on EOL
changed tests that were always skipping to pending
resaved TestFileCatalog.txt with LF EOL to be consistent with behavior on AppVeyor
GUID = '41486F7D-842F-40F1-ACE4-8405F9C2ED9B'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="(c) Microsoft Corporation. All rights reserved."

@iSazonov iSazonov Sep 25, 2017

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we use defferent "c"? I see:

  • Copyright (c)
  • Copyright (C)
  • Copyright ©

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I vaguely recall (c) is completely wrong, (C) has no legal weight, and that © should be used unless the intended process or system cannot parse it (in which case fall back to (C). But I can't find a source.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IANAL, but doing a search tells me the Berne Convention says none of those symbols are actually needed. Let me follow up with our legal team to see what they recommend so we have consistency. Based on prior experience, I don't expect them to get back to me very quickly, so I suggest we have this as a separate issue #4917

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can look CoreFX experience.

Comment thread .gitattributes
@@ -1 +1,3 @@
CHANGELOG.md merge=union
* text=auto

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my reading of the docs, this will only work if the files are not committed CRLF.

When text is set to "auto", the path is marked for automatic end-of-line conversion. If Git decides that the content is text, its line endings are converted to LF on checkin. When the file has been committed with CRLF, no conversion is done.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From https://www.git-scm.com/docs/gitattributes:

If you want to ensure that text files that any contributor introduces to the repository have their line endings normalized, you can set the text attribute to "auto" for all files.

*	text=auto

The actual conversion of files that have CRLF (or worse mixed EOL) will be part of #4910 which we'll do after 6.0.0 final since it touches so many files.

@TravisEz13

Copy link
Copy Markdown
Member

@SteveL-MSFT Do you want to wait for the copyright issue to be resolved before merging?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@TravisEz13 no, I created a separate issue for it #4917

@daxian-dbw

Copy link
Copy Markdown
Member

@SteveL-MSFT quick question, I noticed that some © has been changed to (c) and some are not (e.g. https://github.com/PowerShell/PowerShell/pull/4912/files?w=1#diff-fd6789ade5008bce347f09499cd96bf5R3). Is that intentional?

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

@daxian-dbw I only changed the ones that were using the Unicode version that doesn't show up in VSCode (easy to search for). I left the ones that use extended ascii. So intentional.

@daxian-dbw daxian-dbw merged commit 901a61b into PowerShell:master Sep 25, 2017
@SteveL-MSFT SteveL-MSFT deleted the file-cleanup branch October 26, 2018 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.