Skip to content
This repository was archived by the owner on May 12, 2018. It is now read-only.

Commit a288b51

Browse files
author
Douwe Maan
committed
Merge branch 'sort-commits' into 'master'
Order result of `Repository#commits_between` by date. Addresses internal issue https://dev.gitlab.org/gitlab/gitlabhq/issues/2421. When this is merged, I'll release 7.2.7 and submit a MR to gitlab-ce. Before: ![Screen_Shot_2015-07-30_at_12.26.24](https://gitlab.com/gitlab-org/gitlab_git/uploads/bc04eaf6ede9cdc590542c7d325cce31/Screen_Shot_2015-07-30_at_12.26.24.png) After: ![Screen_Shot_2015-07-30_at_12.26.29](https://gitlab.com/gitlab-org/gitlab_git/uploads/673ff9f3a43451693146761cd3fbd0af/Screen_Shot_2015-07-30_at_12.26.29.png) "JS fix" is from February 2014, "Feature conflcit added" is from August 2014. See merge request !31
2 parents c0652a5 + 129e630 commit a288b51

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
v 7.2.7
2+
- Order result of `Repository#commits_between` by date.
23
- Include branch/tag name in archive file and dirname
34

45
v 7.2.6

lib/gitlab_git/repository.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,12 +296,15 @@ def rev_parse_target(revspec)
296296
#
297297
def commits_between(from, to)
298298
walker = Rugged::Walker.new(rugged)
299+
walker.sorting(Rugged::SORT_DATE | Rugged::SORT_REVERSE)
300+
299301
walker.push(to)
300302
walker.hide(from)
303+
301304
commits = walker.to_a
302305
walker.reset
303306

304-
commits.reverse
307+
commits
305308
end
306309

307310
# Returns the SHA of the most recent common ancestor of +from+ and +to+

0 commit comments

Comments
 (0)