@sytses It is likely, for example when we use rebase, committer date is being changed. This can be also controlled by environment variables (git will use value stored in COMMITTER_DATE environment variable instead of system time).
Nonetheless this problem is (probably) related to timezone. This is --pretty=fuller git log:
commit 18b1ddd4b52c10209ea947a9ca8d15ab09dfb3d8Author: Sytse Sijbrandij <sytse@gitlab.com>AuthorDate: Sat Dec 5 23:09:59 2015 +0000Commit: Sytse Sijbrandij <sytse@gitlab.com>CommitDate: Sat Dec 5 23:09:59 2015 +0000 Add one more PaaScommit d44bce6b01e5cf6c50a84199d8bb86fb07be69f6Author: Sytse Sijbrandij <sytse@gitlab.com>AuthorDate: Fri Dec 4 21:51:33 2015 -0800Commit: Sytse Sijbrandij <sytse@gitlab.com>CommitDate: Fri Dec 4 21:51:33 2015 -0800 Simplify other pages reference.commit 5734a63f1315ccb722c094b665954e09eb439ffcAuthor: Sytse Sijbrandij <sytse@gitlab.com>AuthorDate: Fri Dec 4 21:27:32 2015 -0800Commit: Sytse Sijbrandij <sytse@gitlab.com>CommitDate: Fri Dec 4 21:27:32 2015 -0800 Remove us new hire from index page of handbook.commit 0e02d286d9433341bc1ec5b0a6874195518aad4aAuthor: Sytse Sijbrandij <sytse@gitlab.com>AuthorDate: Sat Dec 5 01:02:43 2015 +0000Commit: Sytse Sijbrandij <sytse@gitlab.com>CommitDate: Sat Dec 5 01:02:43 2015 +0000 Remove hyphens and capitals to make it one sentence.
As you can see, there is different timezone (UTC+0000 and UTC-0800) in those commits. So probably we sort commits using local date, and display commit date using user's timezone (UTC here) (Fri Dec 4 21:27:32 2015 -0800 is around 5am at 5th of December, and this is probably 20 minutes before screenshot was taken, and this is how it is displayed now in commits history).
@grzesiek is right, we show commits grouped by the commit date, regardless of what timezone that's in. This is only an issue when the server timezone and the commit date's timezone disagree about what day a commit happened in. (Commits within a day look like they'll always be in the right order.)
It looks as though there was a second issue when this issue was opened, which has now been fixed, where the timestamp would also be wrong. This was changed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3497 and I can't reproduce that part any more.
I think the fix should just be to convert the commit date to the server timezone before grouping. We can still get a situation where a commit says it happened on one day, but the tooltip shows another (because that uses the user's local timezone), but that could happen anyway and isn't really that surprising: