Patch #1546

Associated revisions are displayed in wrong order for Git, Mercurial (SHA-1 DVCSs)

Added by Daniel Luz over 9 years ago. Updated over 8 years ago.

Status:ClosedStart date:2008-06-29
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:SCM
Target version:0.8

Description

Associated revisions are currently sorted by revision name, in ascending order. (source:trunk/app/models/issue.rb@1594#L31) However, certain SCMs don't use sequential numeric values (for instance: Git, Mercurial and Monotone use SHA-1 hashes), and the commits appear possibly in the wrong order for them.

This trivial patch tries to order first by the committed_on field, leaving the revision as a secondary sorting column.

order-by-committed_on.patch Magnifier - Order primarily by the committed_on field (768 Bytes) Daniel Luz, 2008-06-29 02:50

Associated revisions

Revision 1596
Added by Jean-Philippe Lang over 9 years ago

Fixed: associated revisions are displayed in wrong order on issue view (#1546).

Revision 2519
Added by Jean-Philippe Lang over 8 years ago

Sort changesets in the same order as comments on the issue details view (#1546).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Status changed from New to Closed
  • Target version set to 0.8

You're right. This sort order wasn't updated when the revision field was changed from numeric to string.
Fixed in r1596.

has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"

#2 Updated by Ken Sands over 8 years ago

  • Status changed from Closed to Reopened

has_and_belongs_to_many :changesets, :order => "#{Changeset.table_name}.committed_on ASC, #{Changeset.table_name}.id ASC"

can I suggest this would be nicer (or at least optional) to be DESC rather than ASC so the latest revision is the topmost, as per activity and most other lists throughout the interface? that's how I've set it in mine.

#3 Updated by Jean-Philippe Lang over 8 years ago

  • Status changed from Reopened to Closed

Changed in r2519. Changsets are now sorted in the same order as the comments (which is based on a user preference).

Also available in: Atom PDF