threads / patch / 35234

patchAdd option --no-tags

Subject: [PATCH] Add option --no-tags

## tl;dr

2 messages between Oct 29, 2013 and Oct 30, 2013. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Nicolas Cornu· Oct 29, 2013, 10:44 UTC · lore
>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(-)
Show changes to gitk-git/gitk +10 −4
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· Oct 30, 2013, 15:06 UTC · re: Nicolas Cornu · lore

Re: [PATCH] Add option --no-tags

Nicolas Cornu <ncornu@aldebaran-robotics.com> writes:
Show 8 quoted lines
> 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

← back to recent threads