diff options
author | Sean McGivern <sean@gitlab.com> | 2016-05-18 19:38:00 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2016-05-19 11:36:11 +0300 |
commit | 37415e58f84fb3419eb26673e3eba909e1cb63c1 (patch) | |
tree | e03482d091e020ed551f5862e2efbadecefffb71 /app | |
parent | 27fdd3fe50bd576dc5372c9877eee0216d71c2f1 (diff) |
Chunk commits by date in lists
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.
Diffstat (limited to 'app')
-rw-r--r-- | app/views/projects/commits/_commits.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
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 |