git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH GITK 1/6] gitk: Internal: drawtags: Abolish "singletag" variable

From
IJIan Jackson <ijackson@chiark.greenend.org.uk>
Date
Nov 8, 2016, 00:52 UTC
Message-ID
<20161108005241.19888-2-ijackson@chiark.greenend.org.uk>
In-Reply-To
<20161108005241.19888-1-ijackson@chiark.greenend.org.uk>

We are going to want to make the contents of `marks' somewhat more complicated in a moment, so it won't be possible to use what is effectively a single variable to represent the status of the whole of the non-heads part of the marks list.

Luckily the strings that replace actual tag names, in the `singletag' case, are not themselves valid tag names. So they can be detected directly.

(Also, `singletag' was not quite right anyway: really it meant that the tag name(s) had been abbreviated.)

No functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
---
 gitk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/gitk b/gitk
index 805a1c7..42fa41a 100755
--- a/gitk
+++ b/gitk
@@ -6570,7 +6570,6 @@ proc drawtags {id x xt y1} {
 	if {$ntags > $maxtags ||
 	    [totalwidth $marks mainfont $extra] > $maxwidth} {
 	    # show just a single "n tags..." tag
-	    set singletag 1
 	    if {$ntags == 1} {
 		set marks [list "tag..."]
 	    } else {
@@ -6620,7 +6619,7 @@ proc drawtags {id x xt y1} {
 		       $xr $yt $xr $yb $xl $yb $x [expr {$yb - $delta}] \
 		       -width 1 -outline $tagoutlinecolor -fill $tagbgcolor \
 		       -tags tag.$id]
-	    if {$singletag} {
+	    if {[regexp {^tag\.\.\.|^\d+ } $tag]} {
 		set tagclick [list showtags $id 1]
 	    } else {
 		set tagclick [list showtag $tag_quoted 1]
-- 
2.10.1
Previous: Ian JacksonNext: Ian Jackson
Message 4 of 18 in “Provide for config to specify tags not to abbreviate”
  1. 0/6 Provide for config to specify tags not to abbreviateIan Jackson, Nov 8, 2016
  2. 3/6 gitk: drawtags: Introduce concept of unabbreviated marksIan Jackson, Nov 8, 2016
  3. 2/6 gitk: Internal: drawtags: Idempotently reset "ntags"Ian Jackson, Nov 8, 2016
  4. 1/6 gitk: Internal: drawtags: Abolish "singletag" variableIan Jackson, Nov 8, 2016
  5. 4/6 gitk: Provide for config to specify tags not to abbreviateIan Jackson, Nov 8, 2016
  6. 5/6 config docs: Provide for config to specify tags not to abbreviateIan Jackson, Nov 8, 2016
  7. Jacob KellerNov 8, 2016
  8. Ian JacksonNov 8, 2016
  9. Jeff KingNov 8, 2016
  10. Ian JacksonNov 9, 2016
  11. Junio C HamanoNov 9, 2016
  12. Ian JacksonNov 9, 2016
  13. Junio C HamanoNov 9, 2016
  14. Ian JacksonNov 9, 2016
  15. Markus HitterNov 10, 2016
  16. Ian JacksonNov 8, 2016
  17. Markus HitterNov 8, 2016
  18. Ian JacksonNov 8, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.