Open ianhinder opened 12 years ago
The simple solution is to remember to use --recursive when doing the initial clone. I agree, though, that git module should check for this and print a nicer error message.
Ah but I didn't want to download all the submodules. I wanted to modify the .gitmodules file to cut it down to what I needed before downloading a lot of data. So it looks like the init is the way to go. I think if it printed an error message which told you that you needed to "init", then that would be enough.
To set up a new super-repository, I do the following:
git clone
cd
Edit .gitmodules
git module sync
However, this doesn't work,
vpn-external-022:Kerrness (master) $ git module sync fatal: No such section! Traceback (most recent call last): File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 294, in
sys.exit(main(*sys.argv))
File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 289, in main
args.func(args)
File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 192, in sync_gitmodules
sr.sync_gitmodules()
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 299, in sync_gitmodules
self.rm_submodule(module)
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 186, in rm_submodule
self.config(['--remove-section', 'submodule.'+old])
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 88, in config
return self.git_command(['config'] + command, module)
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 76, in git_command
return check_output(['git', git_dir, work_tree] + command, cwd=self.__path).rstrip('\n')
File "/sw/lib/python2.7/subprocess.py", line 537, in check_output
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['git', '--git-dir=/Users/ian/Cactus/Kerrness/.git', '--work-tree=/Users/ian/Cactus/Kerrness', 'config', '--remove-section', 'submodule.arrangements/CactusTest/TestTypes']' returned non-zero exit status 128
because I didn't do
git submodule init
before the sync. Is it possible to detect that the submodules have not been initialised, and print a nicer error message?