summaryrefslogtreecommitdiff
path: root/gitk
diff options
context:
space:
mode:
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>2006-04-18 21:53:07 (GMT)
committerPaul Mackerras <paulus@samba.org>2006-04-25 12:44:47 (GMT)
commita970fcf249534ca21ad721b289402c135722a24c (patch)
tree1c83bb5cb51a75cce2232970051f5d314884a039 /gitk
parent61e56c8823afd2c5a753a4969330ead0ba850c66 (diff)
downloadgit-a970fcf249534ca21ad721b289402c135722a24c.zip
git-a970fcf249534ca21ad721b289402c135722a24c.tar.gz
git-a970fcf249534ca21ad721b289402c135722a24c.tar.bz2
[PATCH] gitk: Add a visual tag for remote refs
This patch partly changes the background color for remote refs. It makes it easy to quickly distinguish remote refs from local developer branches. I ignore remote HEADs, as these really should be drawn as aliases to other heads. But there is no simple way to detect that HEADs really are aliases for other refs via "git-ls-remote". Signed-off-by: Josef Weidendorfer <Josef.Weidendorfer@gmx.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-xgitk14
1 files changed, 14 insertions, 0 deletions
diff --git a/gitk b/gitk
index 5362b76..7e80a7b 100755
--- a/gitk
+++ b/gitk
@@ -274,10 +274,16 @@ proc readrefs {} {
match id path]} {
continue
}
+ if {[regexp {^remotes/.*/HEAD$} $path match]} {
+ continue
+ }
if {![regexp {^(tags|heads)/(.*)$} $path match type name]} {
set type others
set name $path
}
+ if {[regexp {^remotes/} $path match]} {
+ set type heads
+ }
if {$type == "tags"} {
set tagids($name) $id
lappend idtags($id) $name
@@ -1702,6 +1708,14 @@ proc drawtags {id x xt y1} {
set xl [expr {$xl - $delta/2}]
$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 xi [expr {$x + 1}]
+ set yti [expr {$yt + 1}]
+ set xri [expr {$x + $rwid}]
+ $canv create polygon $xi $yti $xri $yti $xri $yb $xi $yb \
+ -width 0 -fill "#ffddaa" -tags tag.$id
+ }
}
set t [$canv create text $xl $y1 -anchor w -text $tag \
-font $mainfont -tags tag.$id]