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

Re: request: allow passing -X <strategy-option> to git checkout <path> to auto-solve merge conflicts

From
EEErik Cervin Edin <erik@cervined.in>
Date
Dec 28, 2021, 21:50 UTC
Message-ID
<CA+JQ7M9Ht5vSfDDEuYyK7pBPBvgjzi7L6jEYX8dkP4PMFK-M2Q@mail.gmail.com>
In-Reply-To
<a8f3246f-2b50-e713-16c3-1d23b80a42a1@gmail.com>
> On Tue, Dec 28, 2021 at 9:44 PM Andrey Butirsky <butirsky@gmail.com> wrote:
> Thanks Erik, please post your further replies to the mailing list so
> others could see it also.
Mea culpa
> On a topic,
> I'm not familiar with Git code-base so don't know if it even possible in
> it's current architecture..

It looks like builtin/checkout.c checkout_merged is responsible and calls ll-merge.c ll_merge

I think other commands that allow merging strategies may use other "merge drivers".

From commit a944af1d86e6171d68ed2a3aa67b1d68f00e1fe8
Show 7 quoted lines
> merge: teach -Xours/-Xtheirs to binary ll-merge driver
>
> The (discouraged) -Xours/-Xtheirs modes of merge are supposed to
> give a quick and dirty way to come up with a random mixture of
> cleanly merged parts and punted conflict resolution to take contents
> from one side in conflicting parts.  These options however were only
> passed down to the low level merge driver for text.

It looks possible. But perhaps the sentiment is that it's not adviceable?

Previous: Andrey ButirskyNext: Erik Cervin Edin
Message 3 of 6 in “request: allow passing -X <strategy-option> to git checkout <path> to auto-solve merge conflicts”
  1. Andrey ButirskyDec 27, 2021
  2. Andrey ButirskyDec 28, 2021
  3. Erik Cervin EdinDec 28, 2021
  4. Erik Cervin EdinDec 29, 2021
  5. Andrey ButirskyDec 29, 2021
  6. Erik Cervin EdinDec 29, 2021

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.