Re: [RFC] separate .git from working directory
- From
Sean <seanlkml@sympatico.ca>
- Date
- Oct 11, 2006, 15:43 UTC
- Message-ID
- <BAYC1-PASMTP10003954B66E10247020A7AE140@CEZ.ICE>
- In-Reply-To
- <fcaeb9bf0610110623q365d3ffcw9ba9e11936d03a9d@mail.gmail.com>
On Wed, 11 Oct 2006 20:23:50 +0700 "Nguyen Thai Ngoc Duy" <pclouds@gmail.com> wrote:
Show 14 quoted lines
> 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.
Probably wouldn't be too hard to implement, but is it worth it?
You can export a GIT_DIR manually pretty easily if you want to move the .git directory somewhere else. Also you could make a "git find" shell script named "gf" that does something like:
#/bin/sh find "$@" ! -path '*/.git/*'
Which would let you type "gf -name blah" and automatically ignore the .git directory.
Sean