在一个公共项目(B2G即FirefosOS)中,我意外发现git log输出是非按时间顺序排序的:
$ git clone https://git.mozilla.org/releases/gecko.git
$ git log --graph --format='%C(yellow)%h%Creset %cr %C(blue)%<(7,trunc)%cn%Creset -%C(auto)%d%Creset %<(80,trunc)%s' --all
* da7ef8a 74 minutes ago B2G B.. - (origin/v2.1) Bumping manifests a=b2g-bump
* ccf235d 83 minutes ago B2G B.. - Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
* 653f117 7 hours ago B2G B.. - Bumping manifests a=b2g-bump
* cc5501b 7 hours ago B2G B.. - Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
* b4a22de 13 hours ago B2G B.. - Bumping manifests a=b2g-bump
* 4ad0ee9 13 hours ago B2G B.. - Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
* 6390e1b 14 hours ago B2G B.. - Bumping manifests a=b2g-bump
* 9c57530 14 hours ago B2G B.. - Bumping gaia.json for 2 gaia revision(s) a=gaia-bump
* 07e2a96 3 weeks ago Hsin-.. - Bug 1096128 - [B2G][STK] support call number modified by STK call control. r=a..
* 49daf73 3 weeks ago Fredr.. - Bug 1091601 - Settings closes down when changing permissions for THA applicati..
* d4bb883 3 weeks ago Rober.. - Bug 1073252. Fix bustage in part 4, a=bajaj
* 5f3a596 2 days ago B2G B.. - Bumping manifests a=b2g-bump
* 79bdd97 2 days ago B2G B.. - Bumping gaia.json for 1 gaia revision(s)
如何让一个较旧的提交在最近的提交前面呢?
这种行为也可以在Web界面上观察到:https://git.mozilla.org/?p=releases/gecko.git;a=log;h=refs/heads/master
提前感谢。
编辑:真正的问题是:如何可能一次提交(d4bb883)比它的直接父提交(5f3a596)具有更早的提交日期?我可以通过 --graph 选项断言它是直接父提交。