我想知道与 100 submit in branch 相关的提交 ID dev
。(例如:)git rev-list --reverse --branches=dev --date-order --count <commit-id> == 100
:
得到 100 次提交的是1f345e80fba518c72dec7f2e02da5da12be5810f
:
$ git rev-list --reverse --branches=dev --date-order HEAD | head -100 | tail -1
1f345e80fba518c72dec7f2e02da5da12be5810f
$ git rev-list --reverse --branches=dev --date-order HEAD | nl | grep 100
100 1f345e80fba518c72dec7f2e02da5da12be5810f
$ git rev-list --reverse --branches=dev --date-order HEAD | awk '{print NR"\t"$0}' | grep -E ^100
100 1f345e80fba518c72dec7f2e02da5da12be5810f
但是,当我尝试验证有关此 commit-id ( 1f345e80fba518c72dec7f2e02da5da12be5810f
) 的 rev-number 时,结果显示:rev number is 98 !!!
$ git rev-list --reverse --branches=dev --date-order --count 1f345e80fba518c72dec7f2e02da5da12be5810f
98
$ git rev-list --reverse --branches=dev --date-order 1f345e80fba518c72dec7f2e02da5da12be5810f | nl | tail -1
98 1f345e80fba518c72dec7f2e02da5da12be5810f
所以我尝试找出缺少哪个 2 提交:
$ git rev-list --reverse --branches=dev --date-order HEAD | head -100 | nl > commit-100.log
$ git rev-list --reverse --branches=dev --date-order 1f345e80fba518c72dec7f2e02da5da12be5810f | head -100 | nl > commit-98.log
$ diff -y commit-100.log commit-98.log
90 63546ce0207cdd6ade353ea05c466d0210af1d29 | 90 75a8fd85043908049e11595aaa2c988282fa1a0c
91 75a8fd85043908049e11595aaa2c988282fa1a0c | 91 c1bbb33cd0241c16dde2579696c08ed2eb146cdf
92 c1bbb33cd0241c16dde2579696c08ed2eb146cdf | 92 28e9bbc06cb3036bce4cce71f5acf4b27835e9a0
93 28e9bbc06cb3036bce4cce71f5acf4b27835e9a0 | 93 7b1d0caddc6218eb982d27c1df27c885bc84204c
94 7b1d0caddc6218eb982d27c1df27c885bc84204c | 94 945fd63a256391e72e55e8ac98c449c1473c1e5e
95 945fd63a256391e72e55e8ac98c449c1473c1e5e | 95 0ff3f47eb8dc40815ac7effdb2172e5d69dd0e10
96 0ff3f47eb8dc40815ac7effdb2172e5d69dd0e10 | 96 ac90a7b2a371ff7a0fad0475d94691663aceaa1b
97 ac90a7b2a371ff7a0fad0475d94691663aceaa1b | 97 1a0e26b517f88870fed0cf5f346495b67c29463a
98 937807239dd706f3bf124dd4d3266c71fd8071f4 | 98 1f345e80fba518c72dec7f2e02da5da12be5810f
99 1a0e26b517f88870fed0cf5f346495b67c29463a <
100 1f345e80fba518c72dec7f2e02da5da12be5810f <
显然,缺少的 2 个提交 ID 是:
90 63546ce0207cdd6ade353ea05c466d0210af1d29
98 937807239dd706f3bf124dd4d3266c71fd8071f4
根据git show <commit-id>
,并没有什么奇怪的。这两个提交是由同一个人提交的。但是这个人在前 100 次提交中提交了 10 次。
有git rev-list
问题吗?