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

[PATCH] Use git-rev-parse --git-dir to determine GIT_DIR

From
PBPeter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
Date
Nov 30, 2006, 16:45 UTC
Message-ID
<20061130164543.GA11073@xp.machine.xx>
Signed-off-by: Peter Baumann <siprbaum@stud.informatik.uni-erlangen.de>
---
 gitk |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/gitk b/gitk
index ab383b3..60f8212 100755
--- a/gitk
+++ b/gitk
@@ -8,12 +8,7 @@ exec wish "$0" -- "$@"
 # either version 2, or (at your option) any later version.
 
 proc gitdir {} {
-    global env
-    if {[info exists env(GIT_DIR)]} {
-	return $env(GIT_DIR)
-    } else {
-	return ".git"
-    }
+    return [exec git rev-parse --git-dir]
 }
 
 proc start_rev_list {view} {
-- 
1.4.3.3
Message 1 of 1 in “Use git-rev-parse --git-dir to determine GIT_DIR”
  1. Use git-rev-parse --git-dir to determine GIT_DIRPeter Baumann, Nov 30, 2006

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.