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

Failure in submodule directory #24

Closed
smith opened this issue Jun 14, 2012 · 2 comments
Closed

Failure in submodule directory #24

smith opened this issue Jun 14, 2012 · 2 comments

Comments

@smith
Copy link

smith commented Jun 14, 2012

I have a repo which contains a submodule, and there are other submodules in that one. Running git up in the top level works fine, but when I go to the next one I get:

smith@xnwzaizaqh:~/Projects/chef-repo/cookbooks:master$ git up
/Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/grit-2.5.0/lib/grit/git-ruby.rb:116:in `chdir': Not a directory - /Users/smith/Projects/chef-repo/cookbooks/.git (Errno::ENOTDIR)
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/grit-2.5.0/lib/grit/git-ruby.rb:116:in `refs'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/grit-2.5.0/lib/grit/ref.rb:13:in `find_all'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/grit-2.5.0/lib/grit/repo.rb:213:in `heads'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/git-up-0.5.5/lib/git-up.rb:84:in `remote_map'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/git-up-0.5.5/lib/git-up.rb:80:in `remotes'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/git-up-0.5.5/lib/git-up.rb:8:in `run'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/gems/git-up-0.5.5/bin/git-up:5:in `<top (required)>'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/bin/git-up:19:in `load'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/bin/git-up:19:in `<main>'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
  from /Users/smith/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

apparently because the .git here is not a directory, but a file with the contents:

gitdir: ../.git/modules/cookbooks

If possible, I would like git-up to either fetch/rebase all of the submodules recursively or work like normal when run within a submodule. The repo in question (chef-repo) is a private repo, and the one I'm trying to run git-up from is https://github.com/cramerdev/cookbooks

Thanks.

@aanand
Copy link
Owner

aanand commented Jun 20, 2012

Yikes. Didn't know submodules could do weird things with .git.

To be honest, if Grit doesn't know how to handle that then I'm not sure where to begin. You might be best off using a plain git pull --rebase in your submodule directories.

@smith
Copy link
Author

smith commented Jun 23, 2012

Thanks for looking. That's what I've been doing, so there's a workaround. I forgot to mention this only happens on one of my machines and it works fine on the other, both having the same version of git-up, but not sure about ruby or grit or other things' versions. If it continues to be a problem I'll open an issue on Grit or figure something out.

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

No branches or pull requests

2 participants