log --remerge-diff: show what the conflict resolution changedremerge-diff-with-rename-directory-detection
commit9c7f82bb9f16678856de2579a654dba676cfc331
authorThomas Rast <tr@thomasrast.ch>
Sat, 6 Sep 2014 17:57:06 +0000 (6 19:57 +0200)
committerMichael J Gruber <git@grubix.eu>
Wed, 11 Apr 2018 14:40:22 +0000 (11 16:40 +0200)
tree504f066e3473bf951be5f9e9e4750ba1d61d0aed
parentb2f09f2a2d740d2cb9ddb0bd681dd0c309c0ca35
log --remerge-diff: show what the conflict resolution changed

Git has --cc as a very fast inspection tool that shows a brief summary
of what a conflicted merge "looks like", and -c/-m as "give me the
full information" data dumps.

But --cc actually loses information: if the merge lost(!) some changes
from one side, that hunk would fully agree with the other side, and
therefore be elided.  So --cc cannot be used to investigate mismerges.
Indeed it is rather hard to find a merge that has lost changes, unless
one knows where to look.

The new option --remerge-diff is an attempt at filling this gap,
admittedly at the cost of a lot of CPU cycles.  For each merge commit,
it diffs the merge result against a recursive merge of the merge's
parents.

For files that can be auto-merged cleanly, it will typically show
nothing.  However, it will make it obvious when the merge introduces
extra changes.

For files that result in merge conflicts, we diff against the
representation with conflict hunks (what the user would usually see in
the worktree).  So the diff will show what was changed in the conflict
hunks to resolve the conflict.

It still takes a bit of staring to tell an evil from a regular merge.
But at least the information is there, unlike with --cc; and the
output is usually much shorter than with -c.

Signed-off-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/rev-list-options.txt
log-tree.c
merge-recursive.c
merge-recursive.h
revision.c
revision.h
t/t4214-log-remerge-diff.sh [new file with mode: 0755]