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

[RFC] separate .git from working directory

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Oct 11, 2006, 13:23 UTC
Message-ID
<fcaeb9bf0610110623q365d3ffcw9ba9e11936d03a9d@mail.gmail.com>

Hi, I was thinking about this while reading subproject thread. In a simple case, I have a repo A located at ~/project-a and another repo B located at ~/project-a/some/dir/project-b. With this setup, command "find" and other directory-recursive commands will run horribly from ~/project-a when they go inside project-b/.git (no I don't want to repack -d everytime I want to find something). I propose to move project-b/.git outside and place a file, say .gitdir, in project-b directory. git-sh-setup and setup_git_directory are taught to recognize .gitdir, read it to find the actual GIT_DIR recorded inside .gitdir. This way git commands inside project-b should work fine while I can "find ~/project-a -name blah" or "grep -R blah" quickly. .gitdir format could be a simple shell-like format with environment variable assignments. BTW, talking about subproject support, how about git be taught to ignore directories which contain .gitdir so that git commands will not waste time checking project-b directory?

-- 
Duy
Next: Alex Riesen
Message 1 of 12 in “[RFC] separate .git from working directory”
  1. Nguyen Thai Ngoc DuyOct 11, 2006
  2. Alex RiesenOct 11, 2006
  3. SeanOct 11, 2006
  4. SeanOct 11, 2006
  5. Nguyen Thai Ngoc DuyOct 11, 2006
  6. Liu YubaoOct 12, 2006
  7. Liu YubaoOct 12, 2006
  8. Martin WaitzOct 11, 2006
  9. Nguyen Thai Ngoc DuyOct 11, 2006
  10. Junio C HamanoOct 11, 2006
  11. Martin WaitzOct 12, 2006
  12. Nguyen Thai Ngoc DuyOct 21, 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.