简体   繁体   English

分支合并提交后,分支中的最后提交是否有日期?

[英]Can last commit in branch have date after branch merge commit?

I'm looking at old linux kernel log and can't understand something. 我正在看旧的Linux内核日志,无法理解的东西。 How is it possible that last commit in branch (cc8394d) has date after branch merge commit (912afc3)? 分支合并提交(912afc3)之后,分支(cc8394d)中的最后一次提交有可能发生日期吗?

* f8f5701 2012-06-02 Linus Torvalds  (HEAD, v3.5-rc1) Linux 3.5-rc1
*   912afc3 2012-06-02 Linus Torvalds  Merge tag 'dm-3.5-changes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/agk/linux-dm
|\
| * cc8394d 2012-06-03 Joe Thornber  dm thin: provide userspace access to pool metadata
| * a24c256 2012-06-03 Mike Snitzer  dm thin: use slab mempools
| * 3599165 2012-06-03 Mikulas Patocka  dm mpath: allow ioctls to trigger pg init
| * f220fd4 2012-06-03 Mike Christie  dm mpath: delay retry of bypassed pg
| * 1fbdd2b 2012-06-03 Mike Snitzer  dm mpath: reduce size of struct multipath
* |   4fc3acf 2012-06-02 Linus Torvalds  Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

To get this log I used: 要使用此日志,我使用了:

git log --pretty=format:'%h %ad %an %d %s' --date=short --graph

Isn't git(linux kernel maintainer?) is supposed to be aware of timezones and commit dates? 是不是git(linux内核维护者?)应该知道时区和提交日期? Is it a simple mistake or I misunderstand something? 这是一个简单的错误还是我误解了什么?

The difference you can see can be explained by timezone difference. 您可以看到的差异可以通过时区差异来解释。 For example, Joe was in some Europe or Asia, and there was already. 例如,乔在一些欧洲或亚洲,已经有了。 3rd, while Linus was in US, and there still was 2nd. 3,Linus在美国,而且还有第二名。 Git stores internally global Unix time + timezone offset, and you can request them, but by default it uses original timezone, and if you hide it the timestamps may look not in order. Git存储内部全局Unix时间+时区偏移量,您可以请求它们,但默认情况下它使用原始时区,如果您隐藏它,时间戳可能看起来不合适。

Also, git does not do any automatic verification, and you can either have incorrect time at your computer, or intentionally override it as you call git commit (or merge) 此外,git不会进行任何自动验证,您可以在计算机上有不正确的时间,或者在调用git commit(或merge)时故意覆盖它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM