threads / patch / 22324

patchCorrectly launch gitk for branch whose name matches a local file

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

## tl;dr

2 messages between Jan 21, 2010 and Jan 23, 2010. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Peter Krefting· Jan 21, 2010, 12:15 UTC · lore

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 <peter@softwolves.pp.se>
---
 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"
Show changes to git-gui.sh +1 −1
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
Shawn O. Pearce· Jan 23, 2010, 22:41 UTC · re: Peter Krefting · lore

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

Peter Krefting <peter@softwolves.pp.se> wrote:
Show 10 quoted lines
> 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 <peter@softwolves.pp.se>
> ---
>  git-gui.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
Thanks, applied.
 
-- 
Shawn.

← back to recent threads