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

[PATCH 6/6] Rename 'remotes/' to 'r../' in heads

From
Pierre Dumuid <pmdumuid@gmail.com>
Date
Dec 15, 2016, 11:28 UTC
Message-ID
<20161215112847.14719-6-pmdumuid@gmail.com>
In-Reply-To
<20161215112847.14719-1-pmdumuid@gmail.com>
Signed-off-by: Pierre Dumuid <pmdumuid@gmail.com>
---
 gitk | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/gitk b/gitk
index 0903d2d..6f50b06 100755
--- a/gitk
+++ b/gitk
@@ -6731,22 +6731,28 @@ proc drawtags {id x xt y1} {
     set yb [expr {$yt + $linespc - 1}]
     set xvals {}
     set wvals {}
+    set newTags {}
+
     set i -1
     foreach tag $marks {
 	incr i
+	set newTag $tag
+	regsub {^remotes} $newTag "r.." newTag
+
 	if {$i >= $ntags && $i < $ntags + $nheads && $tag eq $mainhead} {
-	    set wid [font measure mainfontbold $tag]
+	    set wid [font measure mainfontbold $newTag]
 	} else {
-	    set wid [font measure mainfont $tag]
+	    set wid [font measure mainfont $newTag]
 	}
 	lappend xvals $xt
 	lappend wvals $wid
+	lappend newTags $newTag
 	set xt [expr {$xt + $wid + $extra}]
     }
     set t [$canv create line $x $y1 [lindex $xvals end] $y1 \
 	       -width $lthickness -fill $reflinecolor -tags tag.$id]
     $canv lower $t
-    foreach tag $marks x $xvals wid $wvals {
+    foreach tag $marks x $xvals wid $wvals newTag $newTags {
 	set tag_quoted [string map {% %%} $tag]
 	set xl [expr {$x + $delta}]
 	set xr [expr {$x + $delta + $wid + $lthickness}]
@@ -6778,7 +6784,10 @@ proc drawtags {id x xt y1} {
 	    $canv create polygon $x $yt $xr $yt $xr $yb $x $yb \
 		-width 1 -outline black -fill $col -tags tag.$id
 	    if {[regexp {^(remotes/.*/|remotes/)} $tag match remoteprefix]} {
-	        set rwid [font measure mainfont $remoteprefix]
+		set newRemotePrefix $remoteprefix
+		regsub {^remotes} $newRemotePrefix "r.." newRemotePrefix
+
+	        set rwid [font measure mainfont $newRemotePrefix]
 		set xi [expr {$x + 1}]
 		set yti [expr {$yt + 1}]
 		set xri [expr {$x + $rwid}]
@@ -6786,7 +6795,7 @@ proc drawtags {id x xt y1} {
 			-width 0 -fill $remotebgcolor -tags tag.$id
 	    }
 	}
-	set t [$canv create text $xl $y1 -anchor w -text $tag -fill $headfgcolor \
+	set t [$canv create text $xl $y1 -anchor w -text $newTag -fill $headfgcolor \
 		   -font $font -tags [list tag.$id text]]
 	if {$ntags >= 0} {
 	    $canv bind $t <1> $tagclick
-- 
2.10.2
Previous: Pierre DumuidNext: Pierre Dumuid
Message 7 of 9 in “Enable ability to visualise the results of git cherry C1 C2”
  1. 1/6 Enable ability to visualise the results of git cherry C1 C2Pierre Dumuid, Dec 15, 2016
  2. 2/6 Add ability to follow a remote branch with a dialogPierre Dumuid, Dec 15, 2016
  3. Paul MackerrasDec 31, 2016
  4. 3/6 Add a tree view to the local branches, remote branches and tags, where / is treated as a directory seperator.Pierre Dumuid, Dec 15, 2016
  5. Paul MackerrasDec 31, 2016
  6. 5/6 gitk: Add a "Save file as" menu itemPierre Dumuid, Dec 15, 2016
  7. 6/6 Rename 'remotes/' to 'r../' in headsPierre Dumuid, Dec 15, 2016
  8. 4/6 Add DirDiffTool as additional optionPierre Dumuid, Dec 15, 2016
  9. Paul MackerrasDec 31, 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.