barrywardell / git-module

A tool for simplifying the management of git submodules
GNU Lesser General Public License v2.1
2 stars 0 forks source link

Run git-module from submodule directories #1

Open ianhinder opened 13 years ago

ianhinder commented 13 years ago

It is inconvenient to have to change directory to the super-repo directory when running some git-module commands. For example, git-module init-upstream. I propose that git-module should work from a submodule as well as from the super-repo, taking the current submodule by default.

barrywardell commented 13 years ago

This has been implemented in 782639f. Can you try that out and let me know if any behavior should be changed?

ianhinder commented 11 years ago

I would like to run "git module init-upstream" from within a submodule, and have this apply to the current submodule. My workflow is usually to be in the submodule committing things to git, and then wanting to push to SVN. If the submodule has not be initialised for SVN, I then need to return to the super-repo directory in order to initialise the submodule. At the moment, if I do this, I get:

[ian@Ians-MacBook-Pro SystemStatistics (trunk)]$ git module init-upstream
Traceback (most recent call last):
File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 369, in <module>
    sys.exit(main(*sys.argv))
File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 364, in main
  args.func(args)
File "/Users/ian/Cactus/EinsteinToolkit/bin/git-module", line 117, in init_upstream
  map(sr.upstream_init, modules)
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 154, in upstream_init
  self.assert_is_submodule(path)
File "/Users/ian/Cactus/EinsteinToolkit/repos/git-module/GitSuperRepository.py", line 126, in assert_is_submodule
  raise ValueError('Error: ' + path + ' is not a submodule.')
ValueError: Error: arrangements/AEIThorns/SystemStatistics/arrangements/AEIThorns/AEILocalInterp is not a   submodule.