From: Michael Rappazzo <rappazzo@gmail.com>
To: paulus@samba.org
Cc: git@vger.kernel.org, Michael Rappazzo <rappazzo@gmail.com>
Subject: [PATCH 2/2] gitk: add an option to enable sorting the "Tags and heads" view by ref type
Date: Wed, 9 Mar 2016 13:18:10 -0500 [thread overview]
Message-ID: <1457547490-12249-3-git-send-email-rappazzo@gmail.com> (raw)
In-Reply-To: <1457547490-12249-1-git-send-email-rappazzo@gmail.com>
Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
---
gitk | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/gitk b/gitk
index 32fbc50..c933233 100755
--- a/gitk
+++ b/gitk
@@ -158,6 +158,7 @@ proc parseviewargs {n arglist} {
global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
global vinlinediff
global worddiff git_version
+ global sort_refs_by_type
set vdatemode($n) 0
set vmergeonly($n) 0
@@ -170,6 +171,7 @@ proc parseviewargs {n arglist} {
set allknown 1
set filtered 0
set i -1
+ set sort_refs_by_type "0"
foreach arg $arglist {
incr i
if {$nextisval} {
@@ -261,6 +263,9 @@ proc parseviewargs {n arglist} {
"--no-replace-objects" {
set env(GIT_NO_REPLACE_OBJECTS) "1"
}
+ "--sort-refs-by-type" {
+ set sort_refs_by_type "1"
+ }
"-*" {
# Other flag arguments including -<n>
if {[string is digit -strict [string range $arg 1 end]]} {
@@ -9929,7 +9934,7 @@ proc reflistfilter_change {n1 n2 op} {
}
proc refill_reflist {} {
- global reflist reflistfilter showrefstop headids tagids otherrefids
+ global reflist reflistfilter showrefstop headids tagids otherrefids sort_refs_by_type
global curview
if {![info exists showrefstop] || ![winfo exists $showrefstop]} return
@@ -9998,6 +10003,10 @@ proc refill_reflist {} {
}
set otherrefs [lsort -index 0 $otherrefs]
lappend refs {*}$localrefs {*}$locally_tracked_remote_refs {*}$remoterefs {*}$tagrefs {*}$otherrefs
+ if {$sort_refs_by_type ne "1"} {
+ set refs [lsort -index 0 $refs]
+ }
+
if {$refs eq $reflist} return
# Update the contents of $showrefstop.list according to the
--
2.7.2
prev parent reply other threads:[~2016-03-09 18:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-09 18:18 [PATCH 0/2] gitk: alter the ordering for the "Tags and heads" view Michael Rappazzo
2016-03-09 18:18 ` [PATCH 1/2] " Michael Rappazzo
2016-03-09 18:18 ` Michael Rappazzo [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457547490-12249-3-git-send-email-rappazzo@gmail.com \
--to=rappazzo@gmail.com \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).