From: Junio C Hamano Date: Tue, 24 Apr 2012 21:40:20 +0000 (-0700) Subject: Merge branch 'hv/submodule-recurse-push' X-Git-Tag: v1.7.11-rc0~111 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=419f2ecf7894726773f7ea5620741ce8ec60e553;p=git.git Merge branch 'hv/submodule-recurse-push' "git push --recurse-submodules" learns to optionally look into the histories of submodules bound to the superproject and push them out. By Heiko Voigt * hv/submodule-recurse-push: push: teach --recurse-submodules the on-demand option Refactor submodule push check to use string list instead of integer Teach revision walking machinery to walk multiple times sequencially --- 419f2ecf7894726773f7ea5620741ce8ec60e553 diff --cc transport.c index 2dfac700b,4177b7d60..1811b500d --- a/transport.c +++ b/transport.c @@@ -1002,17 -994,32 +1003,36 @@@ void transport_set_verbosity(struct tra * Rules used to determine whether to report progress (processing aborts * when a rule is satisfied): * - * 1. Report progress, if force_progress is 1 (ie. --progress). - * 2. Don't report progress, if verbosity < 0 (ie. -q/--quiet ). - * 3. Report progress if isatty(2) is 1. + * . Report progress, if force_progress is 1 (ie. --progress). + * . Don't report progress, if force_progress is 0 (ie. --no-progress). + * . Don't report progress, if verbosity < 0 (ie. -q/--quiet ). + * . Report progress if isatty(2) is 1. **/ - transport->progress = force_progress || (verbosity >= 0 && isatty(2)); + if (force_progress >= 0) + transport->progress = !!force_progress; + else + transport->progress = verbosity >= 0 && isatty(2); } + static void die_with_unpushed_submodules(struct string_list *needs_pushing) + { + int i; + + fprintf(stderr, "The following submodule paths contain changes that can\n" + "not be found on any remote:\n"); + for (i = 0; i < needs_pushing->nr; i++) + printf(" %s\n", needs_pushing->items[i].string); + fprintf(stderr, "\nPlease try\n\n" + " git push --recurse-submodules=on-demand\n\n" + "or cd to the path and use\n\n" + " git push\n\n" + "to push them to a remote.\n\n"); + + string_list_clear(needs_pushing, 0); + + die("Aborting."); + } + int transport_push(struct transport *transport, int refspec_nr, const char **refspec, int flags, int *nonfastforward) diff --cc transport.h index 1631a35ea,c6bee7061..b866c126e --- a/transport.h +++ b/transport.h @@@ -102,7 -102,7 +102,8 @@@ struct transport #define TRANSPORT_PUSH_PORCELAIN 16 #define TRANSPORT_PUSH_SET_UPSTREAM 32 #define TRANSPORT_RECURSE_SUBMODULES_CHECK 64 +#define TRANSPORT_PUSH_PRUNE 128 + #define TRANSPORT_RECURSE_SUBMODULES_ON_DEMAND 256 #define TRANSPORT_SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)