[GIT-GUI PATCH] Correctly launch gitk for branch whose name matches a local file

Subsystems: the rest

STALE3733d

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

[GIT-GUI PATCH] Correctly launch gitk for branch whose name matches a local file

From: Peter Krefting <hidden>
Date: 2016-06-15 22:48:04

When trying to run gitk on a branch name whose name matches a local file,
it will toss an error saying that the name is ambiguous. Adding a pair
of dashes will make gitk parse the options to the left of it as branch
names. Since wish eats the first pair of dashes we throw at it, we need
to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <redacted>
---
 git-gui.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Reproducible test case:

1. git clone git://git.debian.org/users/peterk/lyskom-server.git
2. cd lyskom-server
3. git gui + "Visualize debian's history"
diff --git a/git-gui.sh b/git-gui.sh
index 822d598..2114945 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1941,7 +1941,7 @@ proc do_gitk {revs} {
 		cd [file dirname [gitdir]]
 		set env(GIT_DIR) [file tail [gitdir]]
 
-		eval exec $cmd $revs &
+		eval exec $cmd $revs "--" "--" &
 
 		if {$old_GIT_DIR eq {}} {
 			unset env(GIT_DIR)
-- 
1.6.6

Re: [GIT-GUI PATCH] Correctly launch gitk for branch whose name matches a local file

From: Shawn O. Pearce <hidden>
Date: 2016-06-15 22:48:05

Peter Krefting [off-list ref] wrote:
When trying to run gitk on a branch name whose name matches a local file,
it will toss an error saying that the name is ambiguous. Adding a pair
of dashes will make gitk parse the options to the left of it as branch
names. Since wish eats the first pair of dashes we throw at it, we need
to add a second one to ensure they get through.

Signed-off-by: Peter Krefting <redacted>
---
 git-gui.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, applied.
 
-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help