Skip to contentSkip to conversation

Correctly launch gitk for branch whose name matches a local file

PATCH Applied Peter Krefting 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Correctly launch gitk for branch whose name matches a local file

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.

---
 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"

git-gui.sh +1 -1
index 822d598..2114945 100755
@@ -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)
Signature · 1 line
1.6.6
#1 lore raw
Quoted 10 lines · Peter Krefting

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.

---
 git-gui.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.

Signature · 1 line
Shawn.