Re: [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword

Junio C Hamano <[email protected]> Wed, 23 Dec 2020 11:45:50 -0800
Newsgroups gmane.comp.version-control.git,gmane.linux.gentoo.portage.devel
Message-ID <[email protected]>
Matt Turner <[email protected]> writes:

> I want to handle conflicts automatically on lines like
>
>> KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
>
> where conflicts frequently happen by adding/removing ~ before the
> architecture names or adding/removing whole architectures. I don't
> know if I should use a custom git merge driver or a custom git merge
> strategy.

A merge strategy is about how the changes at the tree level are
handled.  A merge driver is given three blobs (original, your
version, and their version) and comes up with a merged blob.

In your case, you'd want a custom merge driver if you want to handle
word changes on a single line, because the default text merge driver
is pretty much line oriented.