Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vundle can manage Vundle, when it cloned as git submodule #185

Merged
merged 1 commit into from
Jul 1, 2012

Conversation

ykhalyavin
Copy link

When vundle installed as git submodule, git create file '.git' instead of
directory '.git' .

When I do :BundleInstall 'autoload/vundle/installer.vim' think there is no '.git' directory in my 'bundle/vundle'
and try to clone vundle repo. It cause 'directory exists error'

Now we check for '.git' file exists and we think if this file readable, this is git repo.

When vundle installed as git submodule, git create file '.git' instead of
directory '.git'.

And vundle cannot update by self :(
@gmarik
Copy link
Contributor

gmarik commented Jun 21, 2012

Hey @snufrick,
Thanks for the fix! Very usefull!
Haven't had time to test it out yet, will likely do it today!

@gmarik
Copy link
Contributor

gmarik commented Jun 29, 2012

Hey @snufrick, looks like this

git create file '.git' instead of directory '.git'

isn't the case for me

What i did:

$ git submodule add gm:/vundle ./bundle/vundle/
Cloning into bundle/vundle...
remote: Counting objects: 2349, done.
remote: Compressing objects: 100% (1508/1508), done.
remote: Total 2349 (delta 785), reused 2305 (delta 750)
Receiving objects: 100% (2349/2349), 283.74 KiB | 178 KiB/s, done.
Resolving deltas: 100% (785/785), done.

$ G submodule status
 59bff0c457f68c3d52bcebbf6068ea01ac8f5dac bundle/vundle (0.9.1-18-g59bff0c)

$ ls -l1 bundle/vundle/.git/ | wc -l
       8

Which shows that after adding Vundle as a submodule .git/ folder(not a file) was created.
Let me know what i'm doing wrong...
Thanks

PS: sorry for late reply

@rjorgenson
Copy link

I'm having this same problem. The .git folder was created properly on the initial git add submodule but when I checked out the changes to my laptop and ran git submodule init && git submodule update it created the .git file instead of the .git directory and am getting the error when running :BundleInstall

If it makes any difference my vim repo is a submodule of another git repo so vundle is the third tier down.

@erikw
Copy link

erikw commented Jun 30, 2012

This patch works for me using git 1.7.10.4. I hope this can be merged in.

@rjorgenson
Copy link

This patch didn't resolve the issue for me. Here is what the log states with or without the patch applied.

30 [120701 04:01:25] Bundle gmarik/vundle¬
31 [120701 04:01:25] $ git clone https://github.com/gmarik/vundle.git '/Users/robert/.vim/bundle/vundle'¬               
32 [120701 04:01:25] > fatal: destination path '/Users/robert/.vim/bundle/vundle' already exists and is not an empty directory.^@¬

If it matters the contents of the file is just a path to the actual gitdir for the submodule in the parent git repository

gitdir: ../../.git/modules/bundle/vundle

@erikw
Copy link

erikw commented Jul 1, 2012

My .git-file contains the same information:

erikw@inglewood:~/.dotfiles/.vim/bundle/vundle [master]> cat .git
gitdir: ../../../.git/modules/.vim/bundle/vundle

@rjorgenson
Copy link

Were you running :BundleInstall or :BundleInstall! ? I'm curious why this resolved the issue for you but not for me? =[

@erikw
Copy link

erikw commented Jul 1, 2012

Both :BundleInstall and :BundleInstall! works for me.

@rjorgenson
Copy link

Found this https://lkml.org/lkml/2011/12/2/316 .. this appears to be a change in the way git creates .git directories for submodules

"When populating a new submodule directory with "git submodule init",
the $GIT_DIR metainformation directory for submodules is created inside
$GIT_DIR/modules// directory of the superproject and referenced
via the gitfile mechanism. This is to make it possible to switch
between commits in the superproject that has and does not have the
submodule in the tree without re-cloning."

Apparently the fix is to have code that parses the contents of the .git file in the event that it is not a git directory. I wish I knew vimscript so I could write a patch =/

@rjorgenson
Copy link

I tried the patch again on a fresh system(VM) and it worked, I tried it again on the system I was having the problem with and it also worked. I must have forgotten to reload vim the first time I tried it. It doesn't appear to do anything with the .git directory either, just check for it so parsing shouldn't be required. I say commit this patch as well =]

gmarik added a commit that referenced this pull request Jul 1, 2012
Vundle can manage Vundle, when it cloned as git submodule
@gmarik gmarik merged commit d9e2f79 into VundleVim:master Jul 1, 2012
@gmarik
Copy link
Contributor

gmarik commented Jul 1, 2012

Based on feedback i'm merging it in
Thanks everyone!

@Robsteranium Robsteranium mentioned this pull request Jun 6, 2015
AubreySLavigne added a commit to AubreySLavigne/vim-config that referenced this pull request Jun 19, 2018
Vundle was throwing an error when updating Vundle.vim (itself).

Vundle's github has [Issue #185](VundleVim/Vundle.vim#185),
which addresses this issue, if Vundle is installed as a submodule.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants