EOL: patch.eol=auto setting

Martin Geisler mg at lazybytes.net
Mon Dec 21 03:31:28 CST 2009


alexrayne <alexraynepe196 at lavabit.com> writes:

> As understand this change only affects patch, therefore nothing
> changed when i try to look an diff of my work version with CRLF and
> repo-version with LF. look like work is not completed, need support
> for diff too

As Colin mentions, it has always been like this: 'hg diff' operates on
the repository version of files. So you will get output with LF (Unix
format) line endings in your terminal. I asked Patrick on IRC and he
confirmed this and explained that it's no problem for the Windows
terminal to handle LF output (i.e., it wraps the lines correctly).

The reason why we want to produce the same output on all platforms is to
ensure that 'hg diff > patch' gives you a correct patch on all
platforms. In other words, the patch should use the line endings of the
files in the repository instead of the line endings in your working
copy. That ensures that everybody can apply the patch without using
special extensions (they can even use patch(1) to do it).

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.


More information about the Mercurial-devel mailing list