Boost logo

Boost :

Subject: Re: [boost] [git] Line endings in bootstrap.bat on Windows
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-11-28 06:57:09

On Thu, Nov 28, 2013 at 3:35 PM, Philippe Vaucher
<philippe.vaucher_at_[hidden]> wrote:
>> I think the basic issue is that in SVN when one checks out a text file
>> from the repository, line endings are converted from whatever they are in
>> the repository to whatever the OS normally uses; for Windows CR-LF, for
>> Linux LF. SVN does not think that the file has been changed because of
>> this. Then when one commits a file in SVN the line ending is changed back
>> to whatever it was originally in the SVN repository when it is put back in
>> the repository.
>> One would like git to work the same way. I have no idea whether it does or
>> not. But it seems irrelevant from my point of view what the line endings
>> are in a repository as long as when I work on a file locally from a git
>> repostory the line endings are correct for the OS I am on and git does not
>> think there is some change just because the line endings in the repository
>> and the line endings in the file locally are different. I hope git can
>> accomplish this in some way, whether through some local settings or
>> whatever.
> Do people really want this behavior? It looks so hacky/kludgy to me. I
> mean, nowadays all editors can happily edit files with LF or CRLF and save
> them that way too. What do you gain from that behavior, except extra
> configuration of the tools and more headaches? I understand from where this
> feature comes from, back in the days where editors couldn't handle
> different line endings, but this is not the case anymore.

New files are commonly created with native line endings. I'm not very
knowledgeable about git, but if it stores files as-is without any
conversions, then we may have a situation that someone adds and
commits a file with CRLF on Windows and someone else checks it out on
Linux and sees the incorrect line endings. It may be less harmful if
it happens the other way around, but I'd say you shouldn't rely on
that everyone on Windows uses smart enough editors that don't convert
line ending on saving the file. There has to be some protection
against these issues, either in the form of svn-like conversion or
some hooks that don't allow pushing files with incorrect line endings
to github. I don't know if the latter is possible though.

Boost list run by bdawes at, gregod at, cpdaniel at, john at