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

gitk and git-gui with --git-dir and GIT_DIR

From
Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
Date
May 8, 2008, 14:41 UTC
Message-ID
<fvv3e4$i00$1@ger.gmane.org>

I want to track a tree where I should not store a ".git" dir. (You may as well assume I don't have direct write access.) So, the ".git" dir is somewhere else in the filesystem, actually named something like "repo.git".

I know how to make most of git happy with that structure (even diff). Notable exceptions are gitk and git-gui:

gitk:: It requires GIT_DIR to be set and is happy. Only downside is that gitk does not fit inside the git-command scheme. Therefore, any aliasing I do for git commands does not apply to gitk. Having gitk as git-view or such would help.

git-gui:: For non-bare repos it expects git-dirs of the form "path/.git" and bails out otherwise. Even when I rename my git dir to such a path things do not work: all tracked files are reported missing. This happens even when I call git-gui from the actual work tree, i.e. when git diff would work! It seems as if git-gui is CDing to "path" when git-dir is "path/.git", no matter what $PWD, core.worktree or GIT_WORK_TREE say. I don't see why this should be desired behaviour.

Michael
Next: Shawn O. Pearce
Message 1 of 2 in “gitk and git-gui with --git-dir and GIT_DIR”
  1. Michael J GruberMay 8, 2008
  2. Shawn O. PearceMay 8, 2008

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.