use external diff tool in the ignore line-endings mode for merge
Aaron Bentley
aaron at aaronbentley.com
Wed Dec 12 01:32:26 UTC 2012
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 12-12-11 01:25 AM, Fredrik Staxeng wrote:
> Aaron Bentley <aaron at aaronbentley.com> writes:
>
>> On 12-12-09 03:14 AM, Fredrik Staxeng wrote:
>>> If anybody has done this, I would be very grateful for any
>>> details that you can tell me. Which version of diff3, perhaps
>>> where to get it, and how get bazaar to use it.
>>
>> As far as I know, all versions of diff3 work.
>
> Well then, please name one.
>
> Just to make sure you understand the problem.
>
> If you do bzr update on a bound branch, and the line endings has
> changed in a file, the result is a "merged" file that consists of
> the whole of f.THIS, followed by the whole of f.OTHER.
So, AFAIK the '--strip-trailing-cr' is provided by all versions of
diff3, and it does the trick:
$ python
>>> open('base', 'w').write('a\nb\nc\n') open('other',
>>> 'w').write('a\r\na\r\nb\r\nc\r\n') open('this',
>>> 'w').write('a\nb\nc\nc\n')
$ diff3 --merge this base other
<<<<<<< this
a
b
c
c
||||||| base
a
b
c
=======
a
a
b
c
>>>>>>> other
$ diff3 --merge this base other --strip-trailing-cr
a
a
b
c
c
- --strip-trailing-cr is not typically provided by "bzr merge --diff3",
but it's trivial to patch locally. (see bzrlib.patch.py around line 85).
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/
iEYEARECAAYFAlDH3qoACgkQ0F+nu1YWqI379ACeND1Q8n6Jp9aRDKmhCcyuZ8fr
N1EAniviegWmXy5f0jAPOy3wQgGqqc7f
=xfYN
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list