From: Junio C Hamano <gitster@pobox.com>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org, "Łukasz Stelmach" <stlman@poczta.fm>
Subject: Re: [PATCH] gitk: add a checkbox to control the visibility of tags
Date: Sat, 01 Dec 2012 18:16:25 -0800 [thread overview]
Message-ID: <7vlidhmc5i.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <1354309737-4280-1-git-send-email-stlman@poczta.fm> ("Łukasz Stelmach"'s message of "Fri, 30 Nov 2012 22:08:57 +0100")
Łukasz Stelmach <stlman@poczta.fm> writes:
> Enable hiding of tags displayed in the tree as yellow labels.
> If a repository is used together with a system like Gerrit
> there may be quite a lot of tags used to control building
> and there may be hardly any place left for commit subjects.
>
> Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
> ---
Paul, this patch is not done against your tree (does not have gitk
at the top-level), but other than that, the change mimics the way
existing hideremoes is implemented and looks reasonable to me.
We _may_ want to unify these two "hidestuff" into a list of patterns
that hides any ref that match one of the patterns in the list, e.g.
set hidestuff {refs/heads/*/* refs/tags/* refs/remotes/*}
may hide all tags, all remote-tracking branches and local branches
that have a slash in their names.
But that is an independent change that can come later.
> gitk-git/gitk | 23 +++++++++++++++--------
> 1 files changed, 15 insertions(+), 8 deletions(-)
>
> diff --git a/gitk-git/gitk b/gitk-git/gitk
> index d93bd99..274b46b 100755
> --- a/gitk-git/gitk
> +++ b/gitk-git/gitk
> @@ -1754,7 +1754,7 @@ proc readrefs {} {
> global tagids idtags headids idheads tagobjid
> global otherrefids idotherrefs mainhead mainheadid
> global selecthead selectheadid
> - global hideremotes
> + global hideremotes hidetags
>
> foreach v {tagids idtags headids idheads otherrefids idotherrefs} {
> catch {unset $v}
> @@ -1776,6 +1776,7 @@ proc readrefs {} {
> set headids($name) $id
> lappend idheads($id) $name
> } elseif {[string match "tags/*" $name]} {
> + if {$hidetags} continue
> # this lets refs/tags/foo^{} overwrite refs/tags/foo,
> # which is what we want since the former is the commit ID
> set name [string range $name 5 end]
> @@ -2702,7 +2703,7 @@ proc savestuff {w} {
> global cmitmode wrapcomment datetimeformat limitdiffs
> global colors uicolor bgcolor fgcolor diffcolors diffcontext selectbgcolor
> global autoselect autosellen extdifftool perfile_attrs markbgcolor use_ttk
> - global hideremotes want_ttk
> + global hideremotes hidetags want_ttk
>
> if {$stuffsaved} return
> if {![winfo viewable .]} return
> @@ -2725,6 +2726,7 @@ proc savestuff {w} {
> puts $f [list set autosellen $autosellen]
> puts $f [list set showneartags $showneartags]
> puts $f [list set hideremotes $hideremotes]
> + puts $f [list set hidetags $hidetags]
> puts $f [list set showlocalchanges $showlocalchanges]
> puts $f [list set datetimeformat $datetimeformat]
> puts $f [list set limitdiffs $limitdiffs]
> @@ -10864,7 +10866,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
> + global hideremotes hidetags want_ttk have_ttk
>
> set page [create_prefs_page $notebook.general]
>
> @@ -10887,6 +10889,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.hidetags -text [mc "Hide tag labels"] \
> + -variable hidetags
> + grid x $page.hidetags -sticky w
>
> ${NS}::label $page.ddisp -text [mc "Diff display options"]
> grid $page.ddisp - -sticky w -pady 10
> @@ -10988,7 +10993,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 hidetags want_ttk have_ttk
>
> set top .gitkprefs
> set prefstop $top
> @@ -10997,7 +11002,7 @@ proc doprefs {} {
> return
> }
> foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
> - limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
> + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} {
> set oldprefs($v) [set $v]
> }
> ttk_toplevel $top
> @@ -11117,7 +11122,7 @@ proc prefscan {} {
> global oldprefs prefstop
>
> foreach v {maxwidth maxgraphpct showneartags showlocalchanges \
> - limitdiffs tabstop perfile_attrs hideremotes want_ttk} {
> + limitdiffs tabstop perfile_attrs hideremotes hidetags want_ttk} {
> global $v
> set $v $oldprefs($v)
> }
> @@ -11131,7 +11136,7 @@ proc prefsok {} {
> global oldprefs prefstop showneartags showlocalchanges
> global fontpref mainfont textfont uifont
> global limitdiffs treediffs perfile_attrs
> - global hideremotes
> + global hideremotes hidetags
>
> catch {destroy $prefstop}
> unset prefstop
> @@ -11177,7 +11182,8 @@ proc prefsok {} {
> $limitdiffs != $oldprefs(limitdiffs)} {
> reselectline
> }
> - if {$hideremotes != $oldprefs(hideremotes)} {
> + if {$hideremotes != $oldprefs(hideremotes) ||
> + $hidetags != $oldprefs(hidetags)} {
> rereadrefs
> }
> }
> @@ -11601,6 +11607,7 @@ set cmitmode "patch"
> set wrapcomment "none"
> set showneartags 1
> set hideremotes 0
> +set hidetags 0
> set maxrefs 20
> set maxlinelen 200
> set showlocalchanges 1
next prev parent reply other threads:[~2012-12-02 2:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-30 21:08 [PATCH] gitk: add a checkbox to control the visibility of tags Łukasz Stelmach
2012-12-02 2:16 ` Junio C Hamano [this message]
2012-12-02 21:25 ` Lukasz Stelmach
2012-12-02 21:29 ` [PATCH] gitk: read and write a repository specific configuration file Łukasz Stelmach
2012-12-03 21:15 ` Stefan Haller
2012-12-04 20:12 ` Lukasz Stelmach
2012-12-05 0:49 ` [PATCH v2] " Łukasz Stelmach
2012-12-05 15:20 ` Marc Branchaud
2012-12-08 11:27 ` [PATCH] " Łukasz Stelmach
2012-12-09 9:18 ` Junio C Hamano
2012-12-09 10:44 ` Paul Mackerras
2012-12-09 13:25 ` Lukasz Stelmach
2012-12-09 13:13 ` Lukasz Stelmach
2012-12-02 21:40 ` [PATCH] gitk: add a checkbox to control the visibility of tags Felipe Contreras
2013-01-02 7:17 ` Paul Mackerras
2013-01-02 7:24 ` Junio C Hamano
2013-01-02 8:03 ` Lukasz Stelmach
2013-01-02 17:08 ` Junio C Hamano
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=7vlidhmc5i.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=paulus@samba.org \
--cc=stlman@poczta.fm \
/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).