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
ABAndrey Butirsky <butirsky@gmail.com>
Date
Dec 28, 2021, 20:44 UTC
Message-ID
<a8f3246f-2b50-e713-16c3-1d23b80a42a1@gmail.com>
In-Reply-To
<CA+JQ7M-By65FVPnMFnwE8zx3T4O7DV3_5Kf2P6eZhP4Zcemorg@mail.gmail.com>

Thanks Erik, please post your further replies to the mailing list so others could see it also.

On a topic, I'm not familiar with Git code-base so don't know if it even possible in it's current architecture..

On 28.12.2021 20:32, Erik Cervin Edin wrote:
Show 25 quoted lines
> That's my answer =)
>
> I think adding a merge strategy option to checkout might be useful
>
> On Mon, Dec 27, 2021 at 4:49 PM Andrey Butirsky <butirsky@gmail.com> wrote:
>> Hi, stumbling upon this again and again, so decided to write finally,
>>
>> while in conflicting state, the only thing we can do to auto-pick one or
>> another side of conflict is passing --ours/--theirs option to git-checkout:
>> git checkout --ours/--theirs <path>
>>
>> The problem is - it doesn't actually do a _merge_, i.e. you lose all
>> non-conflicted changes.
>>
>> There is no easy way to solve that currently without third-party tools.
>>
>> This link illustrates it:
>> https://stackoverflow.com/a/68498101/1063363
>>
>> Proposal:
>> Shell we add -X <strategy-option> to git checkout <path> to allow it do
>> a merge and _actually solve_ merge conflicts?
>> That would be in-pair with other commands taking the option already:
>> git-merge, git-rebase, (etc.?)
>>
Previous: Andrey ButirskyNext: Erik Cervin Edin
Message 2 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.