EOL best practise

Bob Hood bhood2 at comcast.net
Tue Oct 11 21:52:49 UTC 2016


On 10/11/2016 5:39 AM, Uwe Brauer wrote:
> Hi
>
> I am going to set up two  fresh new repos, which I will share
>
>      -  with someone whomost of the time uses MSDOS line ending
>         convention
>
>      -  and the other one who will use the MaC line ending convention.
>
> So in that case what is the best setting?
>
>
> Should all the users just add the following line to their global .hgrc
> files:
>
>
> [extensions]
> eol =
>
>
>
>
> Or in  addition have the configuration line
>
> [eol]
> native = LF
>
> Which again should have all of the users in their global setting,
> otherwise things might go ugly.

You could also consider writing a server-side hook that normalizes all line 
endings before files are committed.  That way, it doesn't matter what line 
endings the users prefer, they will all be enforced to the same ending just 
prior to being committed.

Admittedly, it's a bit of an advanced solution, but it's also a "gatekeeper": 
Nobody gets past it, and all files in the shared repository are guaranteed to 
be in a "sane" state with regard to line endings.




More information about the Mercurial mailing list