合并功能分支时 git log --merges 的奇怪输出
Weird output for git log --merges when merging feature branches
我有以下 Git 存储库树:
C
|\
| B
|/
A
A: No parents. Initial commit.
Contains foo with content "ABC".
B: Parents: A. "Commit on feature branch".
Contains foo with content "XYZ".
C: Parents: A, B. "Merge of feature branch".
Contains foo with content "XYZ".
我希望 git log --merges foo
显示提交 C
,但是,日志是空的!只有当我也指定 --first-parent
时,它才会显示合并提交 C
。为什么?这是 Git 默认历史记录简化中的错误吗?
不幸的是,Git 文档 (https://git-scm.com/docs/git-log#_history_simplification) 中的历史简化示例不包含与此处完全相同的情况(尽管这可能是最常见的情况...)。
有谁知道,发生了什么事?我很确定它与 Git 的默认历史简化算法有关,因为如果我指定 --full-history
合并提交 C
也会显示。
默认值是否出于某种原因仅遵循提交中的 第二个 父级?
我在 Git 邮件列表中问过同样的问题并得到了适当的答复:
为单个文件询问日志确实打开了历史简化。由于提交 C 完全使用了 B,因此从日志输出中删除了 A 的变更集。与 B 的比较是 TREESAME,因此也被修剪 -> 无输出。
有关详细信息,请参阅 http://thread.gmane.org/gmane.comp.version-control.git/281256。
我有以下 Git 存储库树:
C
|\
| B
|/
A
A: No parents. Initial commit.
Contains foo with content "ABC".
B: Parents: A. "Commit on feature branch".
Contains foo with content "XYZ".
C: Parents: A, B. "Merge of feature branch".
Contains foo with content "XYZ".
我希望 git log --merges foo
显示提交 C
,但是,日志是空的!只有当我也指定 --first-parent
时,它才会显示合并提交 C
。为什么?这是 Git 默认历史记录简化中的错误吗?
不幸的是,Git 文档 (https://git-scm.com/docs/git-log#_history_simplification) 中的历史简化示例不包含与此处完全相同的情况(尽管这可能是最常见的情况...)。
有谁知道,发生了什么事?我很确定它与 Git 的默认历史简化算法有关,因为如果我指定 --full-history
合并提交 C
也会显示。
默认值是否出于某种原因仅遵循提交中的 第二个 父级?
我在 Git 邮件列表中问过同样的问题并得到了适当的答复:
为单个文件询问日志确实打开了历史简化。由于提交 C 完全使用了 B,因此从日志输出中删除了 A 的变更集。与 B 的比较是 TREESAME,因此也被修剪 -> 无输出。
有关详细信息,请参阅 http://thread.gmane.org/gmane.comp.version-control.git/281256。