如果担心恶意合并,git log -p 的合适选项

Suitable options for git log -p if worried about evil merges

我担心我正在查看的给定分支中可能有一些邪恶的合并。我应该向 git log -p 添加哪些选项才能更详细地显示为合并提交显示的差异?

之一
git log -p -c

#(note: two dashes, then two "c"s)
git log -p --cc

似乎是个不错的选择。

来自 git-log

文档的 "Diff Formatting" 部分

Listed below are options that control the formatting of diff output. Some of them are specific to git-rev-list[1], however other diff options may be given. See git-diff-files[1] for more options.

-c

With this option, diff output for a merge commit shows the differences from each of the parents to the merge result simultaneously instead of showing pairwise diff between a parent and the result one at a time. Furthermore, it lists only files which were modified from all parents.

--cc

This flag implies the -c option and further compresses the patch output by omitting uninteresting hunks whose contents in the parents have only two variants and the merge result picks one of them without modification.

似乎--cc旨在显示邪恶的合并,隐藏非邪恶的合并。