git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] separate .git from working directory
@ 2006-10-11 13:23 Nguyen Thai Ngoc Duy
  2006-10-11 14:41 ` Alex Riesen
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2006-10-11 13:23 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [RFC] separate .git from working directory
@ 2006-10-12 12:15 Sergio Callegari
  2006-10-12 13:03 ` Alex Riesen
  0 siblings, 1 reply; 14+ messages in thread
From: Sergio Callegari @ 2006-10-12 12:15 UTC (permalink / raw)
  To: git

Possibly a bit different from the RFC, however,

Other than making find happy, I see other potential advantages in supporting 
the two options of having .git be either

- a directory containing all the git stuff
- a single file with a pointer to the real directory containing the objects, 
references, branches, etc.

1) It might make the life easier on platforms where symlinks are not the 
easiest thing to do (are there any?)

2) it might make it easier to work with syncronization tools (some of you 
might know that I got burnt with them recently). One of the issues of 
syncronizatoin tools is that they typically recognize renames as the 
non-atomical sequence of creation+deletion. Hence imagine the following 
scenario. I have ProjectFoo with the .git dir in. I tell the syncronization 
tool to ignore things called .git (not to get burned again!). I decide to 
rename ProjectFoo into ProjectBar. When I sync, I get with a ProjectBar with 
no .git directory since .git was meant to be ignored and is consequently lost 
in the creation+deletion sequence. All objects are then lost at one of the 
two hosts participating in the syncronization. If .git was only a file with a 
pointer, it would at least be possible to recreate it by hand without 
depending on the other syncronization host.

3) it might make it possible to have all the git archives in a single place, 
where it is easy to program a script to scan all the archives and repack all 
of them periodically or to scan all of them and backup them periodically, 
etc.

Sergio

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-10-21 17:08 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-11 13:23 [RFC] separate .git from working directory Nguyen Thai Ngoc Duy
2006-10-11 14:41 ` Alex Riesen
     [not found]   ` <20061011184844.40b1205d.seanlkml@sympatico.ca>
2006-10-11 22:48     ` Sean
     [not found] ` <20061011114303.0a23496e.seanlkml@sympatico.ca>
2006-10-11 15:43   ` Sean
2006-10-11 21:55     ` Nguyen Thai Ngoc Duy
2006-10-12  4:07       ` Liu Yubao
2006-10-12  5:04         ` Liu Yubao
2006-10-11 18:14 ` Martin Waitz
2006-10-11 21:46   ` Nguyen Thai Ngoc Duy
2006-10-11 22:22     ` Junio C Hamano
2006-10-12  5:21     ` Martin Waitz
2006-10-21 17:08 ` Nguyen Thai Ngoc Duy
  -- strict thread matches above, loose matches on Subject: below --
2006-10-12 12:15 Sergio Callegari
2006-10-12 13:03 ` Alex Riesen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).