diff options
author | Brandon Williams <bmwill@google.com> | 2016-12-19 10:25:33 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-12-20 12:26:34 -0800 |
commit | 225e8bf778d21104da10cfb316e0e2898b24e809 (patch) | |
tree | de1b2a86ba8a6b39aa47de0ac5a3ca004cb5442e /builtin | |
parent | submodules: add RECURSE_SUBMODULES_ONLY value (diff) | |
download | tgif-225e8bf778d21104da10cfb316e0e2898b24e809.tar.xz |
push: add option to push only submodules
Teach push the --recurse-submodules=only option. This enables push
to recursively push all unpushed submodules while leaving the
superproject unpushed.
This is a desirable feature in a scenario where updates to the
superproject are handled automatically by some other means, perhaps
a tool like Gerrit code review. In this scenario, a developer could
make a change which spans multiple submodules and then push their
commits for code review. Upon completion of the code review, their
commits can be accepted and applied to their respective submodules
while the code review tool can then automatically update the
superproject to the most recent SHA1 of each submodule. This would
reduce the merge conflicts in the superproject that could occur if
multiple people are contributing to the same submodule.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/push.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/push.c b/builtin/push.c index 3bb9d6b7e6..9433797539 100644 --- a/builtin/push.c +++ b/builtin/push.c @@ -565,6 +565,8 @@ int cmd_push(int argc, const char **argv, const char *prefix) flags |= TRANSPORT_RECURSE_SUBMODULES_CHECK; else if (recurse_submodules == RECURSE_SUBMODULES_ON_DEMAND) flags |= TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND; + else if (recurse_submodules == RECURSE_SUBMODULES_ONLY) + flags |= TRANSPORT_RECURSE_SUBMODULES_ONLY; if (tags) add_refspec("refs/tags/*"); |