]> git.ipfire.org Git - thirdparty/git.git/commit - rerere.c
rerere: adjust 'forget' to multi-variant world order
authorJunio C Hamano <gitster@pobox.com>
Mon, 28 Mar 2016 21:48:13 +0000 (14:48 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Apr 2016 22:54:41 +0000 (15:54 -0700)
commit890fca84be9d2419939f64872648ebe79e68a0b2
tree9c805fa721b2da244619ecfee91dd87de5d38b67
parent0ce02b362078efe3e3511feb55d2cb5f8e751961
rerere: adjust 'forget' to multi-variant world order

Because conflicts with the same contents inside conflict blocks
enclosed by "<<<<<<<" and ">>>>>>>" can now have multiple variants
to help three-way merge to adjust to the differences outside the
conflict blocks, "rerere forget $path" needs to be taught that there
may be multiple recorded resolutions that share the same conflict
hash (which groups the conflicts with "the same contents inside
conflict blocks"), among which there are some that would not be
relevant to the conflict we are looking at.  These "other variants"
that happen to share the same conflict hash should not be cleared,
and the variant that would apply to the current conflict may not be
the zero-th one (which is the only one that is cleared by the
current code).

After finding the conflict hash, iterate over the existing variants
and try to resolve the conflict using each of them to find the one
that "cleanly" resolves the current conflict.  That is the one we
want to forget and record the preimage for, so that the user can
record the corrected resolution.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
rerere.c
t/t4200-rerere.sh