use external diff tool in the ignore line-endings mode for merge
Frits Jalvingh
jal at etc.to
Tue Dec 11 09:03:37 UTC 2012
Hi,
We had this same problem: a repository consisting of multiple branches
representing different versions of the same product. All kind of files had
bad line endings.
We actually fixed it in the repository and it is not that hard at all
provided that the branches you do have now can merge properly.
What you do is more or less this:
1. You make sure you have crlf support in bzr disabled for the change (no
"rules" file)
2. Check out all branches in some work area
3. Define the proper merge order of those branches
3. Starting at the "lowest" branch (the branch that merges into the next
one(s)):
4. convert all of the files to the proper line endings (we chose LF,
because we enabled Bazaar's line ending support after the change. It is
quite badly implemented but it is better than the anarchy that resulted
without it).
5. Commit that change on that branch - this one is now clean, and the repo
representation for it has only lf.
6. Move to the next branch, and merge the cleaned one in there. This can
generate a /lot/ of conflicts. Just ignore them and do "bzr revert ." Take
care: the dot after the revert, indicating the current directory, is
actually important: it tells bazaar to undo all changes to all files /but
it keeps the merge recorded/ - which is the important part!!! Do not commit
yet.
7. In the same branch again convert all line endings to lf, and commit.
This commit now has done 2 things:
-- it recorded that the merge with the earlier branch was done, so it will
not be retried
-- it has changed all files to lf ;-)
You basically repeat this process over all possible branches. It is
important to hit 'm all and merge the changes through upwards in one go,
because merges that pass "over" this change point will be problematic.
After this you can try to enable bazaar line endings support by adding a
rules file to every workstation and hoping your developers will not forget
to reinstall it when they reinstall their OS....
Greetings,
Frits
On Tue, Dec 11, 2012 at 7:25 AM, Fredrik Staxeng <fstx+u at update.uu.se>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. You tell merge to use
> >it by specifying --diff3 to "bzr merge". If you want to standardize
> >on diff3, I recommend aliasing "merge" to "merge --diff3", e.g. "bzr
> >alias merge=merge\ --diff3"
> >
> >Aaron
> >
>
> 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.
>
>
>
> --
> Fredrik Stax\"ang | rot13: sfgk at hcqngr.hh.fr
> This is all you need to know about vi: ESC : q ! RET
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20121211/de04039d/attachment.html>
More information about the bazaar
mailing list