summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-05-12 14:36:15 +0000
committerRémy Coutable <remy@rymai.me>2016-05-12 14:36:15 +0000
commita9cc14e08b1508156e62c9cf715fb67ebbfd54e4 (patch)
tree5ee70c5aaf9e0fc12b2bf07030af7af7ee09412c
parent9393d6b6f2332c0c369f7b05cb45ed639be99bda (diff)
parentd9574a7b93de7e88c77ed1351650843749da60f0 (diff)
downloadgitlab-ce-a9cc14e08b1508156e62c9cf715fb67ebbfd54e4.tar.gz
Merge branch '3870-commit-sorting-issue' into 'master'
Group commits by date in server timezone `Time#to_date` just takes the (timezone-less) year, date, and month, and creates a new date from that. Because the commits in the list are grouped by date, rather than chunked when the date changes, a commit can be shown in the wrong order if its CommitDate has a timezone-less date that's different to other commits around it. Convert all CommitDates to the server timezone before grouping, as that will at least produce consistent results. Users can still see a timestamp on the commit that doesn't match the date it's grouped under, because the timestamp shown uses the user's local timezone, and the grouping uses the server's timezone, but that was an issue anyway. ### Before ![image](/uploads/1ffe0e2f86e03590cb96126d4f340436/image.png) ### After ![image](/uploads/b1be1b08782385d13c56528242a5829b/image.png) Closes #3870 and closes #17300. See merge request !4052
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/commits/_commits.html.haml2
2 files changed, 2 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 187011c6016..5483b5b6dd9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -36,6 +36,7 @@ v 8.8.0 (unreleased)
- Add support for supressing text diffs using .gitattributes on the default branch (Matt Oakes)
- Add eager load paths to help prevent dependency load issues in Sidekiq workers. !3724
- Added multiple colors for labels in dropdowns when dups happen.
+ - Always group commits by server timezone, not commit timestamp
- Improve description for the Two-factor Authentication sign-in screen. (Connor Shea)
- API support for the 'since' and 'until' operators on commit requests (Paco Guzman)
- Fix Gravatar hint in user profile when Gravatar is disabled. !3988 (Artem Sidorenko)
diff --git a/app/views/projects/commits/_commits.html.haml b/app/views/projects/commits/_commits.html.haml
index 64e8da9201d..82f39e59284 100644
--- a/app/views/projects/commits/_commits.html.haml
+++ b/app/views/projects/commits/_commits.html.haml
@@ -3,7 +3,7 @@
- commits, hidden = limited_commits(@commits)
-- commits.group_by { |c| c.committed_date.to_date }.sort.reverse.each do |day, commits|
+- commits.group_by { |c| c.committed_date.in_time_zone.to_date }.sort.reverse.each do |day, commits|
.row.commits-row
.col-md-2.hidden-xs.hidden-sm
%h5.commits-row-date