Small issue with rerere when one file fails to automatically merge

From: Mike Hommey <hidden>
Date: 2016-06-15 22:45:24

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
quoted
quoted
quoted
quoted
quoted
quoted
master:b
One would expect a not to be unmerged.

Mike
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help