git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Peter Krefting <peter@softwolves.pp.se>
Date
Jan 21, 2010, 12:15 UTC
Message-ID
<20100121121848.BE37D2FC47@perkele>

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
Next: Shawn O. Pearce
Message 1 of 2 in “Correctly launch gitk for branch whose name matches a local file”
  1. Correctly launch gitk for branch whose name matches a local filePeter Krefting, Jan 21, 2010
  2. Shawn O. PearceJan 23, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.