Consider the following situation:
git configuration has rerere.enabled 1
, enabling resolution recording and replay. The following commit history exists:
B
/ \
A---C---E master
\ \ /
D D'
Commit
B
was merged inmaster
with--no-ff
to create commitC
.Commit
B
andD
contain conflicting modifications to a fileFoo
.Commit
D
was rebased toC
creating commitD'
- the conflict inFoo
was erroneously resolved by taking the changes inD
only. The correct resolution would have included changes from bothB
andD
.Commit
D'
was merged into master to create commitE
, and changes toFoo
due to commitB
were lost without conflict.A later inspection revealed the mistake. A attempt to recover was performed by executing
git cherry-pick B
onmaster
with the intention of being able to manually resolve the conflict correctly using a mergetool. However, rerere kicks in and replays the bad resolution. Nogit rerere
invocations seem to be able to show or clear the bad resolution.
What's the best way to deal with this situation? Is it a bug in git that cherry-pick has no rerere override (I am on version 2.9.2)? It feels like something that would crop up often, yet I can't find examples of it being addressed in the documentation (which may be poor searching on my part).
Bear in mind this is a vastly simplified commit tree. In reality there were dozens more commits along the way between those shown, over the period of several days - but the essence of what happened is as captured above.