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

Re: Rebase Question

From
Junio C Hamano <gitster@pobox.com>
Date
May 12, 2021, 06:22 UTC
Message-ID
<xmqqy2ckfp3z.fsf@gitster.g>
In-Reply-To
<YJsk49WBd27NrCAA@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 41 quoted lines
> I don't think rerere helps here. In a rebase like this, the problem is
> that it _isn't_ the same conflict.
>
> Imagine a case like this:
> ...
> Applying the first commit gets this conflict (in diff3 form)
>
>   <<<<<<< ours
>   base
>   another
>   ||||||| base
>   base
>   =======
>   one
>   >>>>>>> theirs
>
> After we fix that up to "one\nanother", the second conflict is:
>
>   <<<<<<< ours
>   one
>   another
>   ||||||| base
>   one
>   =======
>   two
>   >>>>>>> theirs
>
> Likewise, even if you had done the original merge between branch tips,
> you'd have seen yet another conflict:
>
>   <<<<<<< ours
>   two
>   ||||||| base
>   base
>   =======
>   base
>   another
>   >>>>>>> theirs
>
> The actual lines changed are the same, but as the nearby context is
> continually shifting, we don't consider these to be the "same" conflict.

Correct. The conflict you see at each step may be trivial to resolve, but would not "replay" at all, exactly because they are not the same conflicts. Knowing that the user would resolve

    base --> base/another
        \                \
         ---> one--------- one/another
does not help us to decide that
    base --> two -----------
        \                   \
         ---> base/another---???
is resolved to two/another.
Previous: Jeff KingNext: Felipe Contreras
Message 5 of 6 in “Rebase Question”
  1. Andrew OttavianoMay 12, 2021
  2. Jacob KellerMay 12, 2021
  3. Bryan TurnerMay 12, 2021
  4. Jeff KingMay 12, 2021
  5. Junio C HamanoMay 12, 2021
  6. Felipe ContrerasMay 12, 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.