From: David Holmer <odinguru@gmail.com>
To: git@vger.kernel.org
Cc: David Holmer <odinguru@gmail.com>
Subject: [PATCH] gitk: Fix how remote branch names with / are drawn
Date: Tue, 12 Apr 2016 21:59:03 -0400 [thread overview]
Message-ID: <1460512743-27100-1-git-send-email-odinguru@gmail.com> (raw)
Consider this example branch:
remotes/origin/master
gitk displays this branch with different background colors for each part:
"remotes/origin" in orange and "master" in green. The idea is to make it
visually easy to read the branch name separately from the remote name.
However this fails when given this example branch:
remotes/origin/foo/bar
gitk displays this branch with "remotes/origin/foo" in orange and "bar" in
green. This makes it hard to read the branch name "foo/bar". This is due
to an inappropriately greedy regexp. This patch provides a fix so the same
branch will now be displayed with "remotes/origin" in orange and "foo/bar"
in green.
Signed-off-by: David Holmer <odinguru@gmail.com>
---
gitk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitk b/gitk
index 805a1c7..ca2392b 100755
--- a/gitk
+++ b/gitk
@@ -6640,7 +6640,7 @@ 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]} {
+ if {[regexp {^(remotes/[^/]*/|remotes/)} $tag match remoteprefix]} {
set rwid [font measure mainfont $remoteprefix]
set xi [expr {$x + 1}]
set yti [expr {$yt + 1}]
--
1.9.1
next reply other threads:[~2016-04-13 2:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-13 1:59 David Holmer [this message]
2016-04-13 11:35 ` [PATCH] gitk: Fix how remote branch names with / are drawn Mike Rappazzo
2016-04-13 18:19 ` David Holmer
2016-04-13 18:28 ` Mike Rappazzo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1460512743-27100-1-git-send-email-odinguru@gmail.com \
--to=odinguru@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).