Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Handle eol issue in .gitattributes #20

Closed
davidanthoff opened this Issue · 3 comments

2 participants

@davidanthoff

We should add a .gitattributes file that configures eol stuff for the repo. The easiest would be to have one line in it:

"* text=auto"

That will make sure that we only have lf in the repo, irrespective of user/machine settings. We might also add

"*.cs eol=crlf"

That will make sure that all C# files always have crlf when checked out. This will also make sure that when someone downloads the code via "downlad as zip" from github, the C# files will have crlf. We might add a line like that for all file types used in the repo, given that this seems to be a complete windows only project.

@Haacked
Owner

Let's follow the guidance here: http://timclem.wordpress.com/2012/03/01/mind-the-end-of-your-line/

Want to submit a pull request?

@davidanthoff davidanthoff referenced this issue
Merged

EOL stuff #21

@davidanthoff

And here is the pull request. I followed that guidance, BUT, I actually think it is not the best guidance for Windows only projects.

With the guidance from timclem, you essentially tell git "always use LF in the rep for line endings, for checkout use the native EOL of the platform on which you are running". That in general is fine for users that run on windows, files in the working dir will always be CRLF, in the repo everything will always be LF. Where it breaks down is when one uses the "download source as zip" link on github because then one gets files with LF ending, which is clearly not what we would want. I see a couple of solutions to this problem:

1) github detects whether someone is downloading from a windows system, in which case it should do the lf->crlf conversion for the files in the zip file if they are marked as text in gitattributes, because really the native eol in that case is crlf (right now it seems that github uses the native eol of the system on which your web server runs, not ideal)
2) github provides a setting per repository for the eol to be used for downloads
3) one marks *.cs files as eol=crlf, which tells git "always use LF in the rep for line endings, always use CRLF outside of the rep", which for windows only projects actually is the most sensible option, imho. This also makes the zip download use crlf.

Btw, where can one leave feedback for the dev of github itself? A bit opaque how you guys actually get feedback from users, would be nice to have an issues list, forum or something.

@Haacked
Owner

Well my hope is this won't be Windows only over time. Would love it to work on Mono someday. :)

For GitHub, email support@github.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.