]> git.ipfire.org Git - thirdparty/git.git/commit - revision.h
show, log: provide a --remerge-diff capability
authorElijah Newren <newren@gmail.com>
Wed, 2 Feb 2022 02:37:28 +0000 (02:37 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Feb 2022 18:02:27 +0000 (10:02 -0800)
commitdb757e8b8d5527c195c461a04ec35d141ddea48e
treea7f6eff8d025937db3e7344eee1e500ac9cb377b
parent504683162642c0db86c844ea37cad339f928ea9c
show, log: provide a --remerge-diff capability

When this option is specified, we remerge all (two parent) merge commits
and diff the actual merge commit to the automatically created version,
in order to show how users removed conflict markers, resolved the
different conflict versions, and potentially added new changes outside
of conflict regions in order to resolve semantic merge problems (or,
possibly, just to hide other random changes).

This capability works by creating a temporary object directory and
marking it as the primary object store.  This makes it so that any blobs
or trees created during the automatic merge are easily removable
afterwards by just deleting all objects from the temporary object
directory.

There are a few ways that this implementation is suboptimal:
  * `log --remerge-diff` becomes slow, because the temporary object
    directory can fill with many loose objects while running
  * the log output can be muddied with misplaced "warning: cannot merge
    binary files" messages, since ll-merge.c unconditionally writes those
    messages to stderr while running instead of allowing callers to
    manage them.
  * important conflict and warning messages are simply dropped; thus for
    conflicts like modify/delete or rename/rename or file/directory which
    are not representable with content conflict markers, there may be no
    way for a user of --remerge-diff to know that there had been a
    conflict which was resolved (and which possibly motivated other
    changes in the merge commit).
  * when fixing the previous issue, note that some unimportant conflict
    and warning messages might start being included.  We should instead
    make sure these remain dropped.
Subsequent commits will address these issues.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/diff-options.txt
builtin/log.c
diff-merges.c
log-tree.c
revision.h
t/t4069-remerge-diff.sh [new file with mode: 0755]