diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-07-05 00:07:11 -0400 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-07-08 21:12:53 -0400 |
commit | 560eddc00c02e82077998200e8d8a45c31af924c (patch) | |
tree | 8caaab36b4234a09b57344f9190b8104eb1cc4a9 /lib/branch.tcl | |
parent | 7618e6b1c1676dfdc2cc4c8af9e259c3e885825f (diff) | |
download | git-560eddc00c02e82077998200e8d8a45c31af924c.tar.gz git-560eddc00c02e82077998200e8d8a45c31af924c.tar.xz |
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>
Diffstat (limited to 'lib/branch.tcl')
-rw-r--r-- | lib/branch.tcl | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/branch.tcl b/lib/branch.tcl index de638d02e..a6e692117 100644 --- a/lib/branch.tcl +++ b/lib/branch.tcl @@ -21,14 +21,13 @@ proc load_all_heads {} { proc load_all_tags {} { set all_tags [list] - set fd [open "| git for-each-ref --format=%(refname) refs/tags" r] + set fd [open "| git for-each-ref --sort=-taggerdate --format=%(refname) refs/tags" r] while {[gets $fd line] > 0} { if {![regsub ^refs/tags/ $line {} name]} continue lappend all_tags $name } close $fd - - return [lsort $all_tags] + return $all_tags } proc populate_branch_menu {} { |