@matheusbsbs / matheus-bagliano / commits / 560eddc00c
Fork 0

git-gui: Sort tags descending by tagger date

When trying to create a branch from a tag most people are looking for a recent tag, not one that is ancient history. Rather than sorting tags by their string we now sort them by taggerdate, as this places the recent tags at the top of the list and the very old ones at the end. Tag date works nicely as an approximation of the actual history order of commits. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jul 5, 2007 at 00:07 UTC 560eddc00c02e82077998200e8d8a45c31af924c
1 file changed +2 -3
lib/branch.tcl
+2 -3
@@ -21,14 +21,13 @@ proc load_all_heads {} {
21
22 proc load_all_tags {} {
23 set all_tags [list]
24 - set fd [open "| git for-each-ref --format=%(refname) refs/tags" r]
24 + set fd [open "| git for-each-ref --sort=-taggerdate --format=%(refname) refs/tags" r]
25 while {[gets $fd line] > 0} {
26 if {![regsub ^refs/tags/ $line {} name]} continue
27 lappend all_tags $name
28 }
29 close $fd
30 -
31 - return [lsort $all_tags]
30 + return $all_tags
31 }
32
33 proc populate_branch_menu {} {