On Sat, Mar 09, 2013 at 07:18:48PM +0100, Jens Lehmann wrote:
> Am 05.03.2013 22:17, schrieb Phil Hord:
> > In a shell, it usually goes like this:
> > 
> >    git submodule foreach --recursive '${cmd}'
> >    <up><home><del>{30-ish}<end><backspace><enter>
> > 
> > It'd be easier if I could just include a switch for this, and maybe
> > even create an alias for it.  But maybe this is different command
> > altogether.
> Are you sure you wouldn't forget to provide such a switch too? ;-)
> I'm still not convinced we should add a new switch, as it can easily
> be achieved by adding "${cmd} &&" to your scripts. And on the command
> line you could use an alias like this one to achieve that:
> [alias]
>       recurse = !sh -c \"$@ && git submodule foreach --recursive $@\"

I also think it would be useful to have a switch (or even configuration)
to include the superproject.

The following (quite typical) use cases come to my mind:

# Assuming some not yet existing configuration values
git config submodule.recursive true
git config submodule.includeSuper true

# commit your work over the whole tree into one branch
git submodule foreach git checkout -b hv/my-super-cool-feature
git submodule foreach --post-order git commit -a -m "DRAFT: finished work for 
git submodule foreach git push hvoigt hv/my-super-cool-feature

# cleanup
git submodule foreach git clean -xfd

# reset
git submodule foreach git reset --hard


Assuming you have a submodule heavy project and you work on multiple
submodules including the superproject. These are quite typical commands
you would use during development of your feature I imagine. Once you are
finished you need to get your feature upstream by the individual
submodule rules.

On a feature branch during development there is nothing wrong in simply
doing full cross-submodule project commits.

At some point we will probably extend the above commands with a
--recurse-submodules switch but until then this is a good substitute so
why not have a --include-super maybe even as a configuration option ?

Cheers Heiko
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to