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

Re: Should rerere auto-update a merge resolution?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 23, 2017, 20:34 UTC
Message-ID
<xmqqlgmaxbuc.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CACPiFCJH7RSb_rz6M6ADuGi0q+oeWYhE1fNMQC0EUcCn_kCJwg@mail.gmail.com>
Martin Langhoff <martin.langhoff@gmail.com> writes:
Show 21 quoted lines
> Hi List!
>
> Let's say...
>  - git v2.9.4
>  - rerere is enabled.
>  - I merge maint into master, resolve erroneously, commit
>  - I publish my merge in a temp branch, a reviewer points out my mistake
>  - I reset hard, retry the merge, using --no-commit, rerere  applies
> what it knows
>  - I fix things up, then commit
>
> So far so good.
>
> Oops! One of the branches has moved forward in the meantime, so
>
>  - git fetch
>  - git reset --hard master
>  - git merge maint
> ... rerere applies the first (incorrect) resolution...
>
> Am I doing it wrong? {C,Sh}ould rerere have done better?
Between these two steps:
>  - I reset hard, retry the merge, using --no-commit, rerere applies what it knows
>  - I fix things up, then commit

You'd tell rerere to forget what it knows because it is wrong. Then after these two (eh, now "three" because there is the "forget" step), "rerere" notices that an updated resolution needs to be recorded, so it remembers it. Later re-resolution will replay the corrected one, simply because the old incorrect one is forgotten and replaced by the updated correct one.

Previous: Martin LanghoffNext: Martin Langhoff
Message 2 of 8 in “Should rerere auto-update a merge resolution?”
  1. Martin LanghoffAug 23, 2017
  2. Junio C HamanoAug 23, 2017
  3. Martin LanghoffAug 23, 2017
  4. Johannes SchindelinAug 25, 2017
  5. Junio C HamanoAug 25, 2017
  6. Junio C HamanoAug 25, 2017
  7. Junio C HamanoAug 25, 2017
  8. Junio C HamanoAug 25, 2017

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.