]> git.ipfire.org Git - thirdparty/git.git/commit
diff-merges: avoid history simplifications when diffing merges
authorElijah Newren <newren@gmail.com>
Wed, 2 Feb 2022 02:37:37 +0000 (02:37 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 Feb 2022 18:02:28 +0000 (10:02 -0800)
commit0dec322d31db3920872f43bdd2a7ddd282a5be67
tree7f10496966f7c05481bf4a53bdbb30ea84d80d06
parent0d83d8240ddb3f54da44563b73527dbc50c4ed22
diff-merges: avoid history simplifications when diffing merges

Doing diffs for merges are special; they should typically avoid history
simplification.  For example, with

    git log --diff-merges=first-parent -- path

the default history simplification would remove merge commits from
consideration if the file "path" matched the second parent.  That is
counter to what the user wants when looking for first-parent diffs.
Similar comments can be made for --diff-merges=separate (which diffs
against both parents) and --diff-merges=remerge (which diffs against a
remerge of the merge commit).

However, history simplification still makes sense if not doing diffing
merges, and it also makes sense for the combined and dense-combined
forms of diffing merges (because both of those are defined to only show
a diff when the merge result at the relevant paths differs from *both*
parents).

So, for separate, first-parent, and remerge styles of diff-merges, turn
off history simplification.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-merges.c
t/t4069-remerge-diff.sh