0

Working on a ruby/git project using Grit, but I'm unable to update my submodules programmatically. I figured out how the missing_method function maps to git and how to use it to perform tasks not written in to grit, however the submodule update function doesnt seem to work.

Here is an example of my code:

git = Grit::Git.new(@repository)
git.pull
pp git.submodule({:quiet => false, :verbose => true, :progress => true}, "update")

Returns:

""

Thanks in advance!

Z99
  • 73
  • 7

1 Answers1

0

not familiar with grit, but in plain git you would

git submodule update --init --recursive

The init part sets the remote url in the submodule. Hopefully you have :init => true and :recursive => true parameters available. Recursive is optional for you. Use it if your submodule repo has submodules itself.

Hope this helps.

Adam Dymitruk
  • 124,556
  • 26
  • 146
  • 141
  • Typing in the command manually works just fine, however the script I've written is designed to manage these aspects for the user and automatically update the submodule when the parent repository sets the new head for the submodule. – Z99 May 25 '11 at 21:48
  • Sorry, but I'm trying to keep everything contained in the ruby script I've already written. If need be I suppose I can manually execute the git command rather than using grit's built in method of doing so. – Z99 May 27 '11 at 18:56
  • I understand your issue.. I'm wondering what other parameters that submodule method has... – Adam Dymitruk May 27 '11 at 19:06
  • I don't think its a paramaters issue, it may be a bug in grit. I'll see if the maintainer can answer my question maybe. Thanks though! – Z99 Jun 01 '11 at 18:40