# [PATCH] Add option --no-tags

2 messages from 2013-10-29 to 2013-10-30. Participants: Nicolas Cornu, Thomas Rast.
Thread: https://gitlist.dev/t/35234

## Nicolas Cornu, 2013-10-29 10:44

Subject: [PATCH] Add option --no-tags
Message-ID: <CAMXp-VP9DDJ-L=e=7=-bO+ZFVRMVz-PAs0gGv8Q7RrZ-OWof9Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAMXp-VP9DDJ-L%3De%3D7%3D-bO%2BZFVRMVz-PAs0gGv8Q7RrZ-OWof9Q%40mail.gmail.com

```
>From 1cbc2c49454581a67cce09ada1386dac4ffa2828 Mon Sep 17 00:00:00 2001
From: Nicolas Cornu <ncornu@aldebaran-robotics.com>
Date: Tue, 29 Oct 2013 11:31:10 +0100
Subject: [PATCH] Add option --no-tags

---
 gitk-git/gitk | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/gitk-git/gitk b/gitk-git/gitk
index 5cd00d8..d6f5e07 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -156,7 +156,7 @@ proc unmerged_files {files} {

 proc parseviewargs {n arglist} {
     global vdatemode vmergeonly vflags vdflags vrevs vfiltered vorigargs env
-    global worddiff git_version
+    global worddiff git_version no_tags

     set vdatemode($n) 0
     set vmergeonly($n) 0
@@ -167,6 +167,7 @@ proc parseviewargs {n arglist} {
     set origargs $arglist
     set allknown 1
     set filtered 0
+    set no_tags 0
     set i -1
     foreach arg $arglist {
     incr i
@@ -183,6 +184,9 @@ proc parseviewargs {n arglist} {
         set origargs [lreplace $origargs $i $i]
         incr i -1
         }
+      "--no-tags" {
+        set no_tags 1
+      }
         "-[puabwcrRBMC]" -
         "--no-renames" - "--full-index" - "--binary" - "--abbrev=*" -
         "--find-copies-harder" - "-l*" - "--ext-diff" - "--no-ext-diff" -
@@ -6394,13 +6398,16 @@ proc drawtags {id x xt y1} {
     global headbgcolor headfgcolor headoutlinecolor remotebgcolor
     global tagbgcolor tagfgcolor tagoutlinecolor
     global reflinecolor
+    global no_tags

     set marks {}
     set ntags 0
     set nheads 0
     if {[info exists idtags($id)]} {
-    set marks $idtags($id)
-    set ntags [llength $marks]
+      if {$no_tags < 1} {
+        set marks $idtags($id)
+        set ntags [llength $marks]
+      }
     }
     if {[info exists idheads($id)]} {
     set marks [concat $marks $idheads($id)]
--
1.8.4.2

```

## Thomas Rast, 2013-10-30 15:06

Subject: Re: [PATCH] Add option --no-tags
Message-ID: <87ob66g5m7.fsf@linux-k42r.v.cablecom.net>
URL: https://gitlist.dev/e/87ob66g5m7.fsf%40linux-k42r.v.cablecom.net
In-Reply-To: <CAMXp-VP9DDJ-L=e=7=-bO+ZFVRMVz-PAs0gGv8Q7RrZ-OWof9Q@mail.gmail.com>

```
Nicolas Cornu <ncornu@aldebaran-robotics.com> writes:

> From 1cbc2c49454581a67cce09ada1386dac4ffa2828 Mon Sep 17 00:00:00 2001
> From: Nicolas Cornu <ncornu@aldebaran-robotics.com>
> Date: Tue, 29 Oct 2013 11:31:10 +0100
> Subject: [PATCH] Add option --no-tags
>
> ---
>  gitk-git/gitk | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)

This patch suffers from the same problems as the one for the horizontal
scroll bar.  In particular the commit message should (from
Documentation/SubmittingPatches):

  . [explain] the problem the change tries to solve, iow, what is wrong
    with the current code without the change.

  . [justify] the way the change solves the problem, iow, why the
    result with the change is better.

  . [describe] alternate solutions considered but discarded, if any.


On the change itself: from a brief glance it seems you are trying to
hide the tags shown alongside commits (presumably because there are too
many).

However we already have one feature in a similar vein: the tickbox "Hide
remote refs" in Edit->Preferences.  Shouldn't your feature go alongside
it, and be configured in the same way?

-- 
Thomas Rast
tr@thomasrast.ch

```
