Re: [RFC/PATCH] clone: introduce clone.submoduleGitDir to relocate $GITDIR
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Apr 15, 2013, 08:08 UTC
- Message-ID
- <CALkWK0m-X7K=WXFiiMkqZBBTBB9KC6myeN+s_xYLXfadGJCdZQ@mail.gmail.com>
- In-Reply-To
- <7v61zo4igg.fsf@alter.siamese.dyndns.org>
Show 9 quoted lines
> You could continue "git clone" and then teach "git add" (or "git > submodule add") to relocate the embedded git directory from the > submodule working tree, you could "git clone" with separate-git-dir > from the beginning, or you could extend "git add", perhaps > > git add --url=git://up.stre.am/repository [--name=name] sub/mod/ule > > and do that "git clone --separate-git-dir" internally (which will > mean that the end user will not run "git clone").
I specifically did not go down this route, because I think it is gross. Where does moving a GITDIR fit into what git add's normal job (index manipulation) is? Tools should do one specific thing, and do it well: not a mixed bag of unrelated things. git clone, on the other hand, was always intended to have a way to point to a location for GITDIR and the worktree: isn't this feature very close to --separate-git-dir already? It is, therefore, git clone's job to relocate the GITDIR. My future plan is to deny git add'ing anything but a worktree-with-a-gitfile.