From: Michael Rappazzo <rappazzo@gmail.com>
To: paulus@samba.org
Cc: git@vger.kernel.org, Michael Rappazzo <rappazzo@gmail.com>
Subject: [PATCH v3 2/2] gitk: add an option to enable sorting the "Tags and heads" view by ref type
Date: Sun, 27 Mar 2016 11:06:08 -0400 [thread overview]
Message-ID: <1459091168-46908-3-git-send-email-rappazzo@gmail.com> (raw)
In-Reply-To: <1459091168-46908-1-git-send-email-rappazzo@gmail.com>
Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
---
gitk | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/gitk b/gitk
index 3686370..29ef36c 100755
--- a/gitk
+++ b/gitk
@@ -9944,7 +9944,7 @@ proc reflistfilter_change {n1 n2 op} {
}
proc refill_reflist {} {
- global reflist reflistfilter showrefstop headids tagids otherrefids localrefs_tracking_remotes
+ global reflist reflistfilter showrefstop headids tagids otherrefids localrefs_tracking_remotes sortrefsbytype
global curview
if {![info exists showrefstop] || ![winfo exists $showrefstop]} return
@@ -10004,6 +10004,10 @@ proc refill_reflist {} {
}
set otherrefs [lsort -index 0 $otherrefs]
lappend refs {*}$localrefs {*}$locally_tracked_remote_refs {*}$remoterefs {*}$tagrefs {*}$otherrefs
+ if {$sortrefsbytype ne 1} {
+ set refs [lsort -index 0 $refs]
+ }
+
if {$refs eq $reflist} return
# Update the contents of $showrefstop.list according to the
@@ -11416,7 +11420,7 @@ proc create_prefs_page {w} {
proc prefspage_general {notebook} {
global NS maxwidth maxgraphpct showneartags showlocalchanges
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
- global hideremotes want_ttk have_ttk maxrefs
+ global hideremotes want_ttk have_ttk maxrefs sortrefsbytype
set page [create_prefs_page $notebook.general]
@@ -11440,6 +11444,9 @@ proc prefspage_general {notebook} {
${NS}::checkbutton $page.hideremotes -text [mc "Hide remote refs"] \
-variable hideremotes
grid x $page.hideremotes -sticky w
+ ${NS}::checkbutton $page.sortrefsbytype -text [mc "Sort refs by type"] \
+ -variable sortrefsbytype
+ grid x $page.sortrefsbytype -sticky w
${NS}::label $page.ddisp -text [mc "Diff display options"]
grid $page.ddisp - -sticky w -pady 10
@@ -11544,7 +11551,7 @@ proc doprefs {} {
global oldprefs prefstop showneartags showlocalchanges
global uicolor bgcolor fgcolor ctext diffcolors selectbgcolor markbgcolor
global tabstop limitdiffs autoselect autosellen extdifftool perfile_attrs
- global hideremotes want_ttk have_ttk
+ global hideremotes want_ttk have_ttk sortrefsbytype
set top .gitkprefs
set prefstop $top
@@ -11553,7 +11560,8 @@ proc doprefs {} {
return
}
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk \
+ sortrefsbytype} {
set oldprefs($v) [set $v]
}
ttk_toplevel $top
@@ -11679,7 +11687,8 @@ proc prefscan {} {
global oldprefs prefstop
foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
- limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
+ limitdiffs tabstop perfile_attrs hideremotes want_ttk \
+ sortrefsbytype} {
global $v
set $v $oldprefs($v)
}
@@ -12215,6 +12224,7 @@ set showneartags 1
set hideremotes 0
set maxrefs 20
set visiblerefs {"master"}
+set sortrefsbytype 0
set maxlinelen 200
set showlocalchanges 1
set limitdiffs 1
@@ -12318,6 +12328,7 @@ set config_variables {
filesepbgcolor filesepfgcolor linehoverbgcolor linehoverfgcolor
linehoveroutlinecolor mainheadcirclecolor workingfilescirclecolor
indexcirclecolor circlecolors linkfgcolor circleoutlinecolor
+ sortrefsbytype
}
foreach var $config_variables {
config_init_trace $var
--
2.7.4
next prev parent reply other threads:[~2016-03-27 15:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-27 15:06 [PATCH v3 0/2] gitk: changes for the "Tags and heads" view Michael Rappazzo
2016-03-27 15:06 ` [PATCH v3 1/2] gitk: alter the ordering " Michael Rappazzo
2016-12-11 23:25 ` Paul Mackerras
2016-03-27 15:06 ` Michael Rappazzo [this message]
2016-04-28 12:42 ` [PATCH v3 0/2] gitk: changes " Mike Rappazzo
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1459091168-46908-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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).