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

[PATCH (regression, resend)] Handle failure of core.worktree to identify the working directory.

From
Kirill Smelkov <kirr@mns.spb.ru>
Date
May 20, 2010, 09:57 UTC
Message-ID
<1274349477-8747-1-git-send-email-kirr@mns.spb.ru>
From: Pat Thoyts <patthoyts@users.sourceforge.net>

Commit 21985a11 'git-gui: handle non-standard worktree locations' attempts to use either GIT_WORK_TREE or core.worktree to set the _gitworktree variable but these may not be set which leads to a failure to launch gitk to review history. Use _gitdir to set the location for a standard git layout where the parent of the .git directory is the working tree.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Tested-by: Kirill Smelkov <kirr@mns.spb.ru>
---
 git-gui.sh |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 8996d2d..ec81b15 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1158,6 +1158,9 @@ apply_config
 # try to set work tree from environment, falling back to core.worktree
 if {[catch { set _gitworktree $env(GIT_WORK_TREE) }]} {
 	set _gitworktree [get_config core.worktree]
+	if {$_gitworktree eq ""} {
+		set _gitworktree [file dirname [file normalize $_gitdir]]
+	}
 }
 if {$_prefix ne {}} {
 	if {$_gitworktree eq {}} {
-- 
1.7.1.91.ga63a7
Message 1 of 1 in “Handle failure of core.worktree to identify the working directory.”
  1. Handle failure of core.worktree to identify the working directory.Kirill Smelkov, May 20, 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.