Line ending translation extension

Paul Moore p.f.moore at gmail.com
Fri Sep 11 15:02:14 CDT 2009


2009/9/11 Martin Geisler <mg at lazybytes.net>:
> You're right -- we should also convert files upon checkout to match the
> settings in .hgeol. So that means they will get a file in LF format.
> Somewhat unusually, it will be reported as modified when they do 'hg
> status', even though they just made a fresh clone.
>
> It is modified because it's format in the repository (CRLF) doesn't
> match the format it will get using the current filters (LF). They should
> make a commit to bring things back in sync.

Hmm, I can't imagine that people doing a clean checkout would expect
to find modified files, much less have to commit changes. And what
happens if they *don't* commit, but hack and then commit. If 2 people
do that, you'll have a merge to do, which will be mangled by EOL
conflicts (I suspect - not tried this to be sure).

Sounds like there are a number of edge cases that need thinking through here :-)

> This suggests that we should watch for commits to .hgeol and convert
> files (or warn/abort) at that point. That way a change in .hgeol and
> subsequent commit will have everything in sync.

Not sure that'd work as people expect either. If I change .hgeol, then
commit and *other* files get committed, I think I'd be surprised (even
if I understood why it happened after reading the docs...)

Paul.


More information about the Mercurial-devel mailing list