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

[PATCH 5/8] gitk: put temporary directory inside .git

From
Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Date
Apr 5, 2011, 02:14 UTC
Message-ID
<1301969659-19703-6-git-send-email-martin.von.zweigbergk@gmail.com>
In-Reply-To
<1301969659-19703-1-git-send-email-martin.von.zweigbergk@gmail.com>

When running "External diff" from gitk, the "from" and "to" files will first be copied into a directory that is currently ".git/../.gitk-tmp.$pid". When gitk is closed, the directory is deleted. When the work tree is not at ".git/.." (which is supported since the previous commit), that directory may not even be git-related and it does not seem unlikely that permissions may not allow the temporary directory to be created there. Move the directory inside .git instead.

This patch introduces a regression in the case that the .git directory is readonly, but .git/.. is writeable.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
---
 gitk-git/gitk |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 58b98df..b925f3e 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -3332,8 +3332,7 @@ proc gitknewtmpdir {} {
     global diffnum gitktmpdir gitdir
 
     if {![info exists gitktmpdir]} {
-	set gitktmpdir [file join [file dirname $gitdir] \
-			    [format ".gitk-tmp.%s" [pid]]]
+	set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]]
 	if {[catch {file mkdir $gitktmpdir} err]} {
 	    error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err"
 	    unset gitktmpdir
-- 
1.7.4.79.gcbe20
Previous: Martin von ZweigbergkNext: Martin von Zweigbergk
Message 8 of 15 in “make gitk work better in non-top-level directory”
  1. 0/8 make gitk work better in non-top-level directoryMartin von Zweigbergk, Apr 5, 2011
  2. 1/8 gitk: fix file highlight when run in subdirectoryMartin von Zweigbergk, Apr 5, 2011
  3. Paul MackerrasApr 10, 2011
  4. Martin von ZweigbergkApr 10, 2011
  5. 2/8 gitk: fix "show origin of this line" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  6. 3/8 gitk: fix "blame parent commit" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  7. 4/8 gitk: fix "External diff" with separate work treeMartin von Zweigbergk, Apr 5, 2011
  8. 5/8 gitk: put temporary directory inside .gitMartin von Zweigbergk, Apr 5, 2011
  9. 6/8 gitk: run 'git rev-parse --git-dir' only onceMartin von Zweigbergk, Apr 5, 2011
  10. 7/8 gitk: simplify calculation of gitdirMartin von Zweigbergk, Apr 5, 2011
  11. 8/8 gitk: show modified files with separate work treeMartin von Zweigbergk, Apr 5, 2011
  12. Paul MackerrasApr 10, 2011
  13. Junio C HamanoApr 11, 2011
  14. 8/8 gitk: show modified files with separate work treeMartin von Zweigbergk, May 24, 2011
  15. Peter BaumannApr 5, 2011

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.