[Mono-dev] Git line-ending issues

stifu at free.fr stifu at free.fr
Thu Jan 6 15:38:03 EST 2011


No, shamefully I thought I could get away with directly editing the file from the GitHub web interface (which actually works fine with files that aren't "-crlf"). I'll refrain from doing so in the future, as I guess it's not recommended (can't even preview).
Do you have an opinion about how I should fix this issue (if there is actually anything to fix)?

And aren't all those files defined in the .gitattributes file only there for historical reasons, rather than being something desirable? I wouldn't mind going through files (WinForms only, in my case) to convert them all to the same format, if it's something that sounds any good.

----- Mail Original -----
De: "Michael Hutchinson" <m.j.hutchinson at gmail.com>
À: "Stifu" <stifu at free.fr>
Cc: mono-devel-list at lists.ximian.com
Envoyé: Jeudi 6 Janvier 2011 20:35:54 GMT +01:00 Amsterdam / Berlin / Berne / Rome / Stockholm / Vienne
Objet: Re: [Mono-dev] Git line-ending issues

On Thu, Jan 6, 2011 at 2:02 PM, Stifu <stifu at free.fr> wrote:
>
> Hi guys,
>
> I'm having issues with a commit I did (d'oh :(), and would like help to
> clean up my mess.
> The commit can be seen here:
> https://github.com/mono/mono/commit/4d5451a61ce63769083ebad3b1a5d9055a27b6df
>
> I only removed a few lines in the file, but the whole file shows up as
> changed. From what I understand, this is due to a difference in line-ending
> encoding.
> Looking at the .gitattributes file in the same folder, I see certain files
> (including the one I modified) are specified as having a certain line-ending
> encoding (CRLF).

The .gitattributes format is rather unintuitive.

"crlf" means the file is stored as lf in the repo, but converted
to/from crlf on windows.
"-crlf" explicitly disables conversions, in case the user has
autoconversion enabled for all files.

Are you perhaps using a git tools that ignores these attributes?

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-devel-list mailing list