-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add .gitattributes #1756
add .gitattributes #1756
Conversation
Not sure if anyone is developing on mac or windows, nor what tools they are using, but I think most files should be in native encoding. Opinions from mac/windows experts? |
Replace I guess this would work:
I don't think it's good to have
|
macOS uses LF, not CRLF. I agree that we should only translate what is necessary. I was hoping to catch any commits with CRLF and convert them to LF, but that may be overly ambitious. And as you say, may cause grief in some editors. It is my understanding that Update: I tested it, and it works. I even attempted an add, and when adding the file (which was already mentioned in the
|
Windows, and DOS before it, uses a pair of CR and LF characters to terminate lines. UNIX (Including Linux and FreeBSD) uses an LF character only. OS X also uses a single LF character, but the classic Mac operating system used a single CR character for line breaks. https://www.editpadpro.com/tricklinebreak.html |
In my understanding there is no conflict (except that Normally, git tries to automatically detect if a file is a text file or a binary. If git thinks it's a text file it may apply certain conversions on checkout and commit whereas for binaries it doesn't. The Now, the
Question is, should we set |
Aren't they auto already? |
In my understanding this depends on the user's local git configuration |
It is my understanding that the following line does what we want:
Interpretation: Handle all files in the typical way, with the exception of the genesis.json file. For that file, assure that the If the user has their |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think consensus is to not add settings for any other files except genesis.json
.
For genesis.json
, both -text
or eol=lf
should produce identical results at this time, so I don't care which it is.
This fixes #1754
By controlling how git handles text files on Windows, we can assure that the correct chain id gets generated.
Note: This change causes that all text files cloned by git are saved with LF, instead of the Windows standard CRLF. I believe there are no problems in permitting all files to retain their standard non-Windows encoding. But should this cause problems in some area, the
.gitattributes
file can be modified to control which line endings are applied to which files.