git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 23, 2020, 19:45 UTC
Message-ID
<xmqqsg7w8fwx.fsf@gitster.c.googlers.com>
In-Reply-To
<CAEdQ38E9Fepp9gmidcf_HvFMacwPZBr0XgPT5HFs8bHw-SJDZQ@mail.gmail.com>
Matt Turner <mattst88@gentoo.org> writes:
Show 8 quoted lines
> 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.

Previous: Junio C HamanoNext: Matt Turner
Message 4 of 6 in “Re: [RFC PATCH gentoolkit] bin: Add merge-driver-ekeyword”
  1. Matt TurnerDec 22, 2020
  2. Beat BolliDec 23, 2020
  3. Junio C HamanoDec 23, 2020
  4. Junio C HamanoDec 23, 2020
  5. Matt TurnerDec 24, 2020
  6. Junio C HamanoDec 24, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.