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

Re: Amending a merge commit doesn't update the rerere cache

From
Jay Soffian <jaysoffian@gmail.com>
Date
Jun 15, 2010, 13:08 UTC
Message-ID
<AANLkTimlVyDCc72yirAcL0t0YEWErAT_e0Fadq-WbxNM@mail.gmail.com>
In-Reply-To
<4C171C7B.3060904@viscovery.net>
On Tue, Jun 15, 2010 at 2:23 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
Show 6 quoted lines
> There is
>
>        git rerere forget that/conflicted/file
>
> It definitely works as long as the conflict is still recorded in the
> index; I'm not sure if it works after you have staged the updated resolution.

In fact, I use "rerere forget" as part of a hacked up rerere-train that I call after I've gotten my merge correct:

---- snip ----
set -- $(git rev-list --parents HEAD -1)
commit=$1; shift
parent1=$1; shift
other_parents="$@"
if test -z "$other_parents"; then
        echo >&2 "HEAD is not a merge commit"
        exit 1
fi

whence=$(git rev-parse --abbrev-ref HEAD) trap 'git checkout "$whence"' EXIT

git checkout -q "$parent1^0"
if git merge $other_parents; then
        echo "HEAD merges cleanly"
        exit 0
fi

git show -s --pretty=format:"Learning from %h: %s" "$commit" git rerere forget 2>/dev/null git checkout -q $commit -- . git rerere ---- snip ----

I'm still interesting in making commit do the right thing though. In general, rerere is an underdocumented feature; I guess I'll start fixing that part first.

(Aside: and the reason I care about rerere being correct is that I often need to eventually rebase these merges, which is itself a rather delicate procedure.)

j.
Previous: Johannes Sixt
Message 9 of 9 in “Amending a merge commit doesn't update the rerere cache”
  1. Jay SoffianJun 14, 2010
  2. rerere.txt: Document forget subcommandMichael J Gruber, Jun 15, 2010
  3. Junio C HamanoJun 15, 2010
  4. Jay SoffianJun 15, 2010
  5. Michael J GruberJun 16, 2010
  6. Junio C HamanoJun 16, 2010
  7. [PATCHv2] rerere.txt: Document forget subcommandMichael J Gruber, Jul 5, 2010
  8. Johannes SixtJun 15, 2010
  9. Jay SoffianJun 15, 2010

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.