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

2 messages from 2010-01-21 to 2010-01-23. Participants: Peter Krefting, Shawn O. Pearce.
Thread: https://gitlist.dev/t/22324

## Peter Krefting, 2010-01-21 12:15

Subject: [GIT-GUI PATCH] Correctly launch gitk for branch whose name matches a local file
Message-ID: <20100121121848.BE37D2FC47@perkele>
URL: https://gitlist.dev/e/20100121121848.BE37D2FC47%40perkele

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

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, 2010-01-23 22:41

Subject: Re: [GIT-GUI PATCH] Correctly launch gitk for branch whose name matches a local file
Message-ID: <20100123224131.GD12679@spearce.org>
URL: https://gitlist.dev/e/20100123224131.GD12679%40spearce.org
In-Reply-To: <20100121121848.BE37D2FC47@perkele>

```
Peter Krefting <peter@softwolves.pp.se> 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 <peter@softwolves.pp.se>
> ---
>  git-gui.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Thanks, applied.
 
-- 
Shawn.

```
