为什么引入相同更改的合并提交不会从日志中省略?

Why merge commits that introduce same change are not omitted from log?

--cherry-pick 选项声明:

Omit any commit that introduces the same change as another commit on the “other side”

对于下一个 git 命令,我看到下一棵树:

$ git log --graph --decorate --pretty=oneline --abbrev-commit --cherry-mark --boundary --left-right bc2820d...b8d09ce

<   bc2820d (openapi3) Merge branch 'openapi3_exception_handling' into openapi3
|\
| = 4e1e0aa Testcase for not_found/exception requests to api
| = b39673d 'not_found' templates should not be probed automatically. Only when fallback
| = a8677df Dump empty schemas and non empty data
| = 27db48f Implemente before_render hook
|/
<   aa60f0a Merge branch 'hide_temporal_interface' into openapi3
|\
| = 5dd02f2 Mutate current object after update
| = d58c0ab Install missed modules
|/
| >   b8d09ce (xtucha/openapi3) Merge branch 'openapi3_exception_handling' into openapi3
| |\
| | = b6362ad Testcase for not_found/exception requests to api
| | = dc926cc 'not_found' templates should not be probed automatically. Only when fallback
| | = 55dc88d Dump empty schemas and non empty data
| | = 8369185 Implemente before_render hook
| |/
| >   c03438d Merge branch 'hide_temporal_interface' into openapi3
| |\
| | = d534cc4 Mutate current object after update
| | = 1b6af27 Install modules required by MonkeyMan
| |/
| > a3b7230 Clarify schema
|/
o f5b06ed Assign some defaults

如果我只想查看新提交,我会添加 --left-only 选项并在输出中获取合并提交。

<   bc2820d (openapi3) Merge branch 'openapi3_exception_handling' into 
<   aa60f0a Merge branch 'hide_temporal_interface' into openapi3

此提交 引入与 "other side"

上的另一个合并提交 相同的更改

为什么不省略这些提交?

UPD
从上面的示例中,我希望只有一行输出:

> a3b7230 Clarify schema

合并本身被认为是在 ... 的左侧,这也是为什么在图形输出中它被标记为 < 而不是 > 的原因。

要从 git rev-listgit log 输出中消除合并,请添加 --no-merges--max-parents=1(这是同一选项的两种拼写)。

编辑,重新提问编辑:出于 "git cherry" 和类似目的,每个 merge 提交都被认为是唯一的。也就是说,它永远不会与任何其他提交相同,无论其他提交是否是合并。 (发生这种情况有多种内部原因,最重要的是合并提交有多个父项。要计算 补丁 ID,Git 需要将子提交与单亲。)

(编辑 2:上述声明可能是错误的:git show <merge> | git patch-id 为合并的组合差异计算补丁 ID。因此产生相同组合差异的两个合并可能会产生相同的补丁 ID,因此是"the same" 被 git cherry 考虑。但是,在大多数情况下,合并提交的组合差异将不匹配它合并的任何提交的常规、未组合的差异,这意味着在实际上,合并将在 git cherrygit rev-list --cherry-mark 或类似的地方出现。)