git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Hommey <mh@glandium.org>
To: git@vger.kernel.org
Subject: Small issue with rerere when one file fails to automatically merge
Date: Fri, 26 Sep 2008 07:55:52 +0200	[thread overview]
Message-ID: <20080926055552.GA31063@glandium.org> (raw)

Hi,

I recently got this issue with rerere, that can be reproduced with the
workflow below. The problem is that rerere does its job, but fails
to mark the files as being merged when one of the files auto merging
failed.

I haven't taken the time to look into rerere to fix this, though.

$ git init
Initialized empty Git repository in /tmp/test/.git/
[master]$ git config rerere.enabled true
[master]$ echo a > a
[master]$ echo b > b
[master]$ git add a b
[master]$ git commit -m 1
Created initial commit fb0ebe4: 1
 2 files changed, 2 insertions(+), 0 deletions(-)
 create mode 100644 a
 create mode 100644 b
[master]$ git branch foo
[master]$ git branch foo2
[master]$ echo aa > a
[master]$ echo bb > b
[master]$ git commit -a -m 2
Created commit 69f9bf3: 2
 2 files changed, 2 insertions(+), 2 deletions(-)
[master]$ git co foo
Switched to branch "foo"
[foo]$ echo ab > a
[foo]$ echo bc > b
[foo]$ git commit -a -m 3
Created commit 991c054: 3
 2 files changed, 2 insertions(+), 2 deletions(-)
[foo]$ git merge master
Auto-merging a
CONFLICT (content): Merge conflict in a
Auto-merging b
CONFLICT (content): Merge conflict in b
Recorded preimage for 'a'
Recorded preimage for 'b'
Automatic merge failed; fix conflicts and then commit the result.
[foo]$ echo aab > a
[foo]$ echo bbc > b
[foo]$ GIT_EDITOR=cat git commit -a
<snip>
Recorded resolution for 'a'.
Recorded resolution for 'b'.
Created commit 98c88e2: Merge branch 'master' into foo
[foo]$ git co foo2
Switched to branch "foo2"
[foo2]$ echo ab > a
[foo2]$ echo bd > b
[foo2]$ git commit -a -m 4
Created commit 9c65461: 4
 2 files changed, 2 insertions(+), 2 deletions(-)
[foo2]$ git merge master
Auto-merging a
CONFLICT (content): Merge conflict in a
Auto-merging b
CONFLICT (content): Merge conflict in b
Recorded preimage for 'b'
Resolved 'a' using previous resolution.
Automatic merge failed; fix conflicts and then commit the result.
[foo2]$ git status
a: needs merge
b: needs merge
# On branch foo2
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       unmerged:   a
#       unmerged:   b
#
no changes added to commit (use "git add" and/or "git commit -a")
[foo2]$ cat a
aab
[foo2]$ cat b
<<<<<<< HEAD:b
bd
=======
bb
>>>>>>> master:b

One would expect a not to be unmerged.

Mike

                 reply	other threads:[~2008-09-26  5:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080926055552.GA31063@glandium.org \
    --to=mh@glandium.org \
    --cc=git@vger.kernel.org \
    /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).