Git merge disappointment

chombee chombee at lavabit.com
Sun Apr 25 21:08:33 CEST 2010


On Sun, Apr 25, 2010 at 03:00:49PM +0100, chombee wrote:
> Yeah. I've been looking around, and it looks like there are a couple of
> options. You can get diff3 style or svn style merge conflicts, but
> neither seems like it will be any more useful. And you can provide your
> own program to carry out the merge, git calls this a "custom merge
> driver". It should be possible to write a simple one for my case.

..and here is a first attempt at a custom merge driver for this scenario:

http://gist.github.com/378623

It seems to work, doing an automatic merge in the case when the branch
you're pulling from has new text at the beginning of the file but no
other changes. If there are any other kinds of change it fails and
prints out a diff, leaves the file in your work tree unmodified. I'd
like to have it write the merge conflicts to the file in your work tree
as git would normally do when automatic merge fails but I haven't
figured that out yet. It'd be nice if git provided some way for a custom
merge driver to give up and fall back on the default merge driver, but I
don't know if does.


More information about the vcs-home mailing list