Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can last commit in branch have date after branch merge commit?

I'm looking at old linux kernel log and can't understand something. How is it possible that last commit in branch (cc8394d) has date after branch merge commit (912afc3)?

* 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? Is it a simple mistake or I misunderstand something?

like image 290
kostr22 Avatar asked Jan 30 '26 20:01

kostr22


1 Answers

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. 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.

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)

like image 66
max630 Avatar answered Feb 01 '26 10:02

max630



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!