[PATCH 08/13] gitk: only change the color of the "remote" part of remote refs
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Dec 19, 2016, 16:45 UTC
- Message-ID
- <3d99aed51a9a03ad50cfd612f3f67f61a338b316.1482164633.git.mhagger@alum.mit.edu>
- In-Reply-To
- <cover.1482164633.git.mhagger@alum.mit.edu>
If a remote-tracking reference has the form
refs/remotes/origin/foo/bar
, then the part of the reference that tells which remote it comes from is `refs/remotes/origin`. So display such a reference as
remotes/origin/foo/bar
^^^^^^^^^^^^^^^, where the indicated part is displayed in `$remotebgcolor`. The old code always split the reference name at its last slash, thus rendering the above remote-tracking reference as
remotes/origin/foo/bar
^^^^^^^^^^^^^^^^^^^, which makes no sense at all.
Note that this commit doesn't change the rendering of remote-tracking references with only two slashes (e.g., `refs/remotes/foo`). Such references were created by `git-svn` when using its old naming scheme. They are still rendered like
remotes/foo
^^^^^^^^Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> --- gitk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gitk b/gitk index 51ebaf5..c146a15 100755 --- a/gitk +++ b/gitk @@ -6558,7 +6558,7 @@ proc remotereftext {head textName prefixName} { upvar $textName text upvar $prefixName prefix - if {[regexp {^((remotes/(.*/|)).*)} $head match text prefix]} { + if {[regexp {^((remotes/([^/]+/|)).*)} $head match text prefix]} { return 1 } else { set text $head
-- 2.9.3