tpope/vim-fugitive — Issue #139: Support new remote, bare git submodules
Author: guns
Created: 2011-12-26 06:04:21+00:00
State: open

As of [this commit][commit], cloning via `git submodule add` produces
a repo with a gitdir file at .git. which in turn points to a bare
repository whose directory name _does not_ end in `.git`.

$ git init MyFoo; cd MyFoo
Initialized empty Git repository in /tmp/MyFoo/.git/

$ git submodule add git://github.com/tpope/vim-fugitive my/path/to/fugitive
Cloning into 'my/path/to/fugitive'...

$ cat my/path/to/fugitive/.git
gitdir: /private/tmp/MyFoo/.git/modules/my/path/to/fugitive

$ ls /private/tmp/MyFoo/.git/modules/my/path/to/fugitive
HEAD branches config description hooks index info logs objects packed-refs refs

Fugitive does not presently handle remote git-dirs, and also does not
handle bare repositories whose directory names do not end in `.git`
[(cf. issue 117)][comment]

While it is easy to patch ExtractGitDir() to return the remote git-dir
path, I opted not to implement the bare repo detection, since there are
many approaches to that problem (conventions, shelling out, etc).

Merry Christmas!

[commit]: https://github.com/git/git/commit/501770e1bb5d132ae4f79aa96715f07f6b84e1f6
[comment]: https://github.com/tpope/vim-fugitive/issues/117#issuecomment-2356133