git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: git <git@vger.kernel.org>
Subject: Re: Amending a merge commit doesn't update the rerere cache
Date: Tue, 15 Jun 2010 09:08:57 -0400	[thread overview]
Message-ID: <AANLkTimlVyDCc72yirAcL0t0YEWErAT_e0Fadq-WbxNM@mail.gmail.com> (raw)
In-Reply-To: <4C171C7B.3060904@viscovery.net>

On Tue, Jun 15, 2010 at 2:23 AM, Johannes Sixt <j.sixt@viscovery.net> wrote:
> 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.

      reply	other threads:[~2010-06-15 13:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-14 23:04 Amending a merge commit doesn't update the rerere cache Jay Soffian
2010-06-15  6:21 ` [PATCH] rerere.txt: Document forget subcommand Michael J Gruber
2010-06-15 16:37   ` Junio C Hamano
2010-06-15 16:45     ` Jay Soffian
2010-06-16  7:42     ` Michael J Gruber
2010-06-16 17:33       ` Junio C Hamano
2010-07-05 13:15         ` [PATCHv2] " Michael J Gruber
2010-06-15  6:23 ` Amending a merge commit doesn't update the rerere cache Johannes Sixt
2010-06-15 13:08   ` Jay Soffian [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTimlVyDCc72yirAcL0t0YEWErAT_e0Fadq-WbxNM@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).