summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2016-05-18 17:38:00 +0100
committerSean McGivern <sean@gitlab.com>2016-05-19 09:36:11 +0100
commit37415e58f84fb3419eb26673e3eba909e1cb63c1 (patch)
treee03482d091e020ed551f5862e2efbadecefffb71
parent27fdd3fe50bd576dc5372c9877eee0216d71c2f1 (diff)
downloadgitlab-ce-12724-wrong-sorting-of-commit-order-in-mr-view.tar.gz
It's possible to construct a commit graph where the output of `git log` isn't in timestamp order. Grouping the commits in the list by date then gives dramatically wrong results. Instead, go for the more pragmatic approach: use the commits in the order they're given, and just show the date line each time the date changes. This means that the same date header can show up multiple times, but at least the ordering is preserved.
-rw-r--r--CHANGELOG2
-rw-r--r--app/views/projects/commits/_commits.html.haml2
2 files changed, 2 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 2dd80779541..49c9bbd51fa 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -43,7 +43,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
+ - Show commits in the same order as `git log`
- 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 82f39e59284..7283a78a64e 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.in_time_zone.to_date }.sort.reverse.each do |day, commits|
+- commits.chunk { |c| c.committed_date.in_time_zone.to_date }.each do |day, commits|
.row.commits-row
.col-md-2.hidden-xs.hidden-sm
%h5.commits-row-date