pull: optionally rebase submodules
cover pull: optionally rebase submodules
This supersedes the RFC in May by Brandon
https://public-inbox.org/git/[email protected]/
It adds more (enough?) error checking, as explained in the last commit message.
Documentation and issues raised in the review
of that RFC have been addressed.
The first two patches are a little refactoring needed for the last patch that adds the functionality.
Thanks,
Stefan
Stefan Beller (3):
builtin/fetch: factor submodule recurse parsing out to submodule
config
builtin/fetch: parse recurse-submodules-default at default options
parsing
pull: optionally rebase submodules (remote submodule changes only)
Documentation/git-pull.txt | 12 ++++---- builtin/fetch.c | 37 ++++++++--------------- builtin/pull.c | 73 +++++++++++++++++++++++++++++++++++++++------- submodule-config.c | 22 ++++++++++++++ submodule-config.h | 3 ++ submodule.c | 26 +++++++++++++++++ submodule.h | 4 +++ t/t5572-pull-submodule.sh | 58 ++++++++++++++++++++++++++++++++++++ 8 files changed, 194 insertions(+), 41 deletions(-)
Signature · 1 line
2.12.2.575.gb14f27f917
PATCH 1/3 builtin/fetch: factor submodule recurse parsing out to submodule config
Later we want to access this parsing in builtin/pull as well.
--- builtin/fetch.c | 18 ++---------------- submodule-config.c | 22 ++++++++++++++++++++++ submodule-config.h | 3 +++ 3 files changed, 27 insertions(+), 16 deletions(-)
builtin/fetch.c +2 -16
@@ -53,20 +53,6 @@ static int shown_url = 0;static int refmap_alloc, refmap_nr;static const char **refmap_array; -static int option_parse_recurse_submodules (const struct option *opt, -const char *arg,int unset) -{ -if (unset) { - recurse_submodules =RECURSE_SUBMODULES_OFF ; - }else { -if (arg) - recurse_submodules =parse_fetch_recurse_submodules_arg (opt->long_name, arg); -else - recurse_submodules =RECURSE_SUBMODULES_ON ; - } -return 0 ; -} -static int git_fetch_config (const char *k,const char *v,void *cb) {if (!strcmp (k,"fetch.prune" )) {
@@ -115,9 +101,9 @@ static struct option builtin_fetch_options[] = { N_("number of submodules fetched in parallel")),OPT_BOOL ('p' ,"prune" , &prune,N_ ("prune remote-tracking branches no longer on remote" )), - { OPTION_CALLBACK, 0, "recurse-submodules", NULL, N_("on-demand"), + { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, N_("on-demand"),N_ ("control recursive fetching of submodules" ), - PARSE_OPT_OPTARG, option_parse_recurse_submodules }, + PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules },OPT_BOOL (0 ,"dry-run" , &dry_run,N_ ("dry run" )), OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),
submodule-config.c +22 -0
@@ -2,6 +2,7 @@#include "submodule-config.h" #include "submodule.h" #include "strbuf.h" +#include "parse-options.h" /* * submodule cache lookup structure
@@ -234,6 +235,27 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg)return parse_fetch_recurse (opt, arg,1 ); } +int option_fetch_parse_recurse_submodules (const struct option *opt, +const char *arg,int unset) +{ +int *v; + +if (!opt->value) +return -1 ; + + v = opt->value; + +if (unset) { + *v =RECURSE_SUBMODULES_OFF ; + }else { +if (arg) + *v =parse_fetch_recurse_submodules_arg (opt->long_name, arg); +else + *v =RECURSE_SUBMODULES_ON ; + } +return 0 ; +} +static int parse_update_recurse (const char *opt,const char *arg,int die_on_error) {
submodule-config.h +3 -0
@@ -23,6 +23,9 @@ struct submodule { };extern int parse_fetch_recurse_submodules_arg (const char *opt,const char *arg); +struct option ; +extern int option_fetch_parse_recurse_submodules (const struct option *opt, +const char *arg,int unset);extern int parse_update_recurse_submodules_arg (const char *opt,const char *arg);extern int parse_push_recurse_submodules_arg (const char *opt,const char *arg);extern int parse_submodule_config_option (const char *var,const char *value);
Signature · 1 line
2.12.2.575.gb14f27f917
PATCH 2/3 builtin/fetch: parse recurse-submodules-default at default options parsing
In reply to Stefan BellerInstead of just storing the string and then later calling our own parsing function 'parse_fetch_recurse_submodules_arg', make use of the function callback 'option_fetch_parse_recurse_submodules' that was introduced in the last patch. Also move all submodule recursing variables in one spot at the top of the file.
--- builtin/fetch.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
builtin/fetch.c +10 -9
@@ -36,7 +36,7 @@ static int prune = -1; /* unspecified */#define PRUNE_BY_DEFAULT 0/* do we prune by default? */ static int all, append, dry_run, force, keep, multiple, update_head_ok, verbosity, deepen_relative; -static int progress =-1 , recurse_submodules =RECURSE_SUBMODULES_DEFAULT ; +static int progress =-1 ;static int tags =TAGS_DEFAULT , unshallow, update_shallow, deepen;static int max_children =-1 ;static enum transport_family family;
@@ -48,7 +48,8 @@ static struct strbuf default_rla = STRBUF_INIT;static struct transport *gtransport;static struct transport *gsecondary;static const char *submodule_prefix ="" ; -static const char *recurse_submodules_default; +static int recurse_submodules =RECURSE_SUBMODULES_DEFAULT ; +static int recurse_submodules_default =RECURSE_SUBMODULES_DEFAULT ;static int shown_url =0 ;static int refmap_alloc, refmap_nr;static const char **refmap_array;
@@ -123,9 +124,11 @@ static struct option builtin_fetch_options[] = { PARSE_OPT_NONEG | PARSE_OPT_NOARG, NULL, 1 }, {OPTION_STRING ,0 ,"submodule-prefix" , &submodule_prefix,N_ ("dir" ), N_("prepend this to submodule path output"), PARSE_OPT_HIDDEN }, - { OPTION_STRING, 0, "recurse-submodules-default", - &recurse_submodules_default,NULL , - N_("default mode for recursion"), PARSE_OPT_HIDDEN }, + { OPTION_CALLBACK, 0, "recurse-submodules-default", + &recurse_submodules_default,N_ ("on-demand" ), +N_ ("default for recursive fetching of submodules " +"(lower priority than config files)" ), + PARSE_OPT_HIDDEN, option_fetch_parse_recurse_submodules },OPT_BOOL (0 ,"update-shallow" , &update_shallow,N_ ("accept refs that update .git/shallow" )), { OPTION_CALLBACK, 0, "refmap", NULL, N_("refmap"),
@@ -1333,10 +1336,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) deepen =1 ;if (recurse_submodules !=RECURSE_SUBMODULES_OFF ) { -if (recurse_submodules_default) { -int arg =parse_fetch_recurse_submodules_arg ("--recurse-submodules-default" , recurse_submodules_default); -set_config_fetch_recurse_submodules (arg); - } +if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) +set_config_fetch_recurse_submodules (recurse_submodules_default);gitmodules_config ();git_config (submodule_config,NULL ); }
Signature · 1 line
2.12.2.575.gb14f27f917
PATCH 3/3 pull: optionally rebase submodules (remote submodule changes only)
In reply to Stefan BellerTeach pull to optionally update submodules when '--recurse-submodules' is provided. This will teach pull to run 'submodule update --rebase' when the '--recurse-submodules' and '--rebase' flags are given under specific circumstances.
On a rebase workflow:
=====================
1. Both sides change the submodule
------------------------------
Let's assume the following history in a submodule:
H---I---J---K---L local branch
\
M---N---O---P remote branchand the following in the superproject (recorded submodule in parens):
A(H)---B(I)---F(K)---G(L) local branch
\
C(N)---D(N)---E(P) remote branchIn an ideal world this would rebase the submodule and rewrite the submodule pointers that the superproject points at such that the superproject looks like
A(H)---B(I) F(K')---G(L') rebased branch
\ /
C(N)---D(N)---E(P) remote branchand the submodule as:
J---K---L (old dangeling tip)
/
H---I J'---K'---L' rebased branch
\ /
M---N---O---P remote branchAnd if a conflict arises in the submodule the superproject rebase would stop at that commit at which the submodule conflict occurs.
Currently a "pull --rebase" in the superproject produces a merge conflict as the submodule pointer changes are conflicting and cannot be resolved.
2. Local submodule changes only
-----------------------
Assuming histories as above, except that the remote branch would not contain submodule changes, then a result as
A(H)---B(I) F(K)---G(L) rebased branch
\ /
C(I)---D(I)---E(I) remote branchis desire-able. This is what currently happens in rebase.
If the recursive flag is given, the ideal git would produce a superproject as:
A(H)---B(I) F(K')---G(L') rebased branch (incl. sub rebase!)
\ /
C(I)---D(I)---E(I) remote branchand the submodule as:
J---K---L (old dangeling tip)
/
H---I J'---K'---L' locally rebased branch
\ /
M---N---O---P advanced branchThis patch doesn't address this issue, however
a test is added that this fails up front.
3. Remote submodule changes only
----------------------
Assuming histories as in (1) except that the local superproject branch would not have touched the submodule the rebase already works out in the superproject with no conflicts:
A(H)---B(I) F(P)---G(P) rebased branch (no sub changes)
\ /
C(N)---D(N)---E(P) remote branchThe recurse flag as presented in this patch would additionally update the submodule as:
H---I J'---K'---L' rebased branch
\ /
M---N---O---P remote branchAs neither J, K, L nor J', K', L' are referred to from the superproject, no rewriting of the superproject commits is required.
Conclusion for 'pull --rebase --recursive'
-----------------------------------------
If there are no local superproject changes it is sufficient to call "submodule update --rebase" as this produces the desired results. In case of conflicts, the behavior is the same as in 'submodule update --recursive' which is assumed to be sane.
This patch implements (3) only.
On a merge workflow:
====================
We'll start off with the same underlying DAG as in (1) in the rebase workflow. So in an ideal world a 'pull --merge --recursive' would produce this:
H---I---J---K---L----X
\ /
M---N---O---Pwith X as the new merge-commit in the submodule and the superproject as:
A(H)---B(I)---F(K)---G(L)---Y(X)
\ /
C(N)---D(N)---E(P)However modifying the submodules on the fly is not supported in git-merge such that Y(X) is not easy to produce in a single patch. In fact git-merge doesn't know about submodules at all.
However when at least one side does not contain commits touching the submodule at all, then we do not need to perform the merge for the submodule but a fast-forward can be done via checking out either L or P in the submodule. This strategy is implemented in 68d03e4a6e (Implement automatic fast-forward merge for submodules, 2010-07-07) already, so to align with the rebase behavior we need to also update the worktree of the submodule.
--- Documentation/git-pull.txt | 12 ++++---- builtin/pull.c | 73 +++++++++++++++++++++++++++++++++++++++------- submodule.c | 26 +++++++++++++++++ submodule.h | 4 +++ t/t5572-pull-submodule.sh | 58 ++++++++++++++++++++++++++++++++++++ 5 files changed, 157 insertions(+), 16 deletions(-)
Documentation/git-pull.txt +6 -6
@@ -86,12 +86,12 @@ OPTIONS --[no-]recurse-submodules[=yes|on-demand|no]:: This option controls if new commits of all populated submodules should - be fetched too (see linkgit:git-config[1] and linkgit:gitmodules[5]). - That might be necessary to get the data needed for merging submodule - commits, a feature Git learned in 1.7.3. Notice that the result of a - merge will not be checked out in the submodule, "git submodule update" - has to be called afterwards to bring the work tree up to date with the - merge result. + be fetched and updated, too (see linkgit:git-config[1] and + linkgit:gitmodules[5]). ++ +If the checkout is done via rebase, local submodule commits are rebased as well. ++ +If the update is done via merge, the submodule conflicts are resolved and checked out. Options related to merging ~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin/pull.c +63 -10
129 lines not on this page · raw message
submodule.c +26 -0
@@ -1126,6 +1126,32 @@ static void calculate_changed_submodule_paths(void) initialized_fetch_ref_tips =0 ; } +int submodule_touches_in_range (struct object_id *excl_oid, +struct object_id *incl_oid) +{ +struct string_list subs =STRING_LIST_INIT_DUP ; +struct argv_array args =ARGV_ARRAY_INIT ; +int ret; + +gitmodules_config (); +/* No need to check if there are no submodules configured */ +if (!submodule_from_path (NULL ,NULL )) +return 0 ; + +argv_array_push (&args,"--" );/* args[0] program name */ +argv_array_push (&args,oid_to_hex (incl_oid)); +argv_array_push (&args,"--not" ); +argv_array_push (&args,oid_to_hex (excl_oid)); + +collect_changed_submodules (&subs, &args); + ret = subs.nr; + +argv_array_clear (&args); + +free_submodules_oids (&subs); +return ret; +} +struct submodule_parallel_fetch {int count;struct argv_array args;
submodule.h +4 -0
@@ -97,6 +97,10 @@ extern int merge_submodule(struct object_id *result, const char *path,const struct object_id *base, const struct object_id *a, const struct object_id *b, int search); + +/* Checks if there are submodule changes in a..b. */ +extern int submodule_touches_in_range (struct object_id *a, +struct object_id *b);extern int find_unpushed_submodules (struct oid_array *commits,const char *remotes_name,struct string_list *needs_pushing);
t/t5572-pull-submodule.sh +58 -0
62 lines not on this page · raw message
Signature · 1 line
2.12.2.575.gb14f27f917
Re: [PATCH 1/3] builtin/fetch: factor submodule recurse parsing out to submodule config
In reply to Stefan BellerQuoted 59 lines · Stefan Beller
Later we want to access this parsing in builtin/pull as well.
Signed-off-by Stefan Beller <[email protected]>--- builtin/fetch.c | 18 ++---------------- submodule-config.c | 22 ++++++++++++++++++++++ submodule-config.h | 3 +++ 3 files changed, 27 insertions(+), 16 deletions(-)builtin/fetch.c +2
-16@@ -53,20 +53,6 @@ static int shown_url = 0;static int refmap_alloc, refmap_nr;static const char **refmap_array; -static int option_parse_recurse_submodules (const struct option *opt, -const char *arg,int unset) -{ -if (unset) { - recurse_submodules =RECURSE_SUBMODULES_OFF ; - }else { -if (arg) - recurse_submodules =parse_fetch_recurse_submodules_arg (opt->long_name, arg); -else - recurse_submodules =RECURSE_SUBMODULES_ON ; - } -return 0 ; -} -static int git_fetch_config (const char *k,const char *v,void *cb) {if (!strcmp (k,"fetch.prune" )) {@@ -115,9 +101,9 @@ static struct option builtin_fetch_options[] = { N_("number of submodules fetched in parallel")),OPT_BOOL ('p' ,"prune" , &prune,N_ ("prune remote-tracking branches no longer on remote" )), - { OPTION_CALLBACK, 0, "recurse-submodules", NULL, N_("on-demand"), + { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, N_("on-demand"),N_ ("control recursive fetching of submodules" ), - PARSE_OPT_OPTARG, option_parse_recurse_submodules }, + PARSE_OPT_OPTARG, option_fetch_parse_recurse_submodules },OPT_BOOL (0 ,"dry-run" , &dry_run,N_ ("dry run" )), OPT_BOOL('k', "keep", &keep, N_("keep downloaded pack")),submodule-config.c +1
-0@@ -2,6 +2,7 @@#include "submodule-config.h" #include "submodule.h" #include "strbuf.h" +#include "parse-options.h" /* * submodule cache lookup structure
submodule-config.c int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg) · line 244
Quoted 10 lines
submodule-config.c +7
-0@@ -234,6 +235,27 @@ int parse_fetch_recurse_submodules_arg(const char *opt, const char *arg)return parse_fetch_recurse (opt, arg,1 ); } +int option_fetch_parse_recurse_submodules (const struct option *opt, +const char *arg,int unset) +{ +int *v; + +if (!opt->value) +return -1 ;
It would have been easier to view this change if the original already had used opt->value to specify where to place the parsed value, but that is water under the bridge ;-)
Looks like a faithful converison to me.
Quoted 30 lines
submodule-config.c +13
-0+ v = opt->value; + +if (unset) { + *v =RECURSE_SUBMODULES_OFF ; + }else { +if (arg) + *v =parse_fetch_recurse_submodules_arg (opt->long_name, arg); +else + *v =RECURSE_SUBMODULES_ON ; + } +return 0 ; +} +static int parse_update_recurse (const char *opt,const char *arg,int die_on_error) {submodule-config.h +3
-0@@ -23,6 +23,9 @@ struct submodule { };extern int parse_fetch_recurse_submodules_arg (const char *opt,const char *arg); +struct option ; +extern int option_fetch_parse_recurse_submodules (const struct option *opt, +const char *arg,int unset);extern int parse_update_recurse_submodules_arg (const char *opt,const char *arg);extern int parse_push_recurse_submodules_arg (const char *opt,const char *arg);extern int parse_submodule_config_option (const char *var,const char *value);
Re: [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing
In reply to Stefan Bellerbuiltin/fetch.c int cmd_fetch(int argc, const char **argv, const char *prefix) · line 1340
Quoted 10 lines · Stefan Beller
builtin/fetch.c +2
-4@@ -1333,10 +1336,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) deepen =1 ;if (recurse_submodules !=RECURSE_SUBMODULES_OFF ) { -if (recurse_submodules_default) { -int arg =parse_fetch_recurse_submodules_arg ("--recurse-submodules-default" , recurse_submodules_default); -set_config_fetch_recurse_submodules (arg); - } +if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) +set_config_fetch_recurse_submodules (recurse_submodules_default);
This is not a new thing, and it may not even be a problem, but I have to wonder why this needs to be done conditionally. "The command line did not explicitly say --no-recurse-submodules, so we would set what came from --recurse-submodule-default if and only if that is given---otherwise we leave it as a compiled-in default" is what the code before or after this patch tells me. But if we drop the "if (default is not DEFAULT)", the resulting code becomes "The command line did not explicitly say --no-recurse-submodules, so we would set whatever is the default (which may not have been given from the command line, but came built-in to the binary)". Aren't they saying the same thing?
It's not like there is a configuration knob that further interferes the interaction between these two. I am puzzled.
Quoted 3 lines
builtin/fetch.c +0
-0gitmodules_config ();git_config (submodule_config,NULL ); }
Re: [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing
Quoted 16 lines · Junio C Hamano
builtin/fetch.c int cmd_fetch(int argc, const char **argv, const char *prefix) · line 1340
Quoted 10 lines · Stefan Beller
builtin/fetch.c +2
-4@@ -1333,10 +1336,8 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) deepen =1 ;if (recurse_submodules !=RECURSE_SUBMODULES_OFF ) { -if (recurse_submodules_default) { -int arg =parse_fetch_recurse_submodules_arg ("--recurse-submodules-default" , recurse_submodules_default); -set_config_fetch_recurse_submodules (arg); - } +if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) +set_config_fetch_recurse_submodules (recurse_submodules_default);This is not a new thing, and it may not even be a problem, but I have to wonder why this needs to be done conditionally. "The command line did not explicitly say --no-recurse-submodules, so we
Quoted 8 lines
would set what came from --recurse-submodule-default if and only if that is given---otherwise we leave it as a compiled-in default" is what the code before or after this patch tells me. But if we drop the "if (default is not DEFAULT)", the resulting code becomes "The command line did not explicitly say --no-recurse-submodules, so we would set whatever is the default (which may not have been given from the command line, but came built-in to the binary)". Aren't they saying the same thing?
I assumed so as well, yes. But the test suite pointed out there is another subtlety going on, which I have not dug into, yet.
Quoted 3 lines
It's not like there is a configuration knob that further interferes the interaction between these two. I am puzzled.
As far as I suspect, the original author considered evaluating the additional config too expensive.
gitmodules_config(); // <- this specifically?
git_config(submodule_config, NULL);And that is why we only react if any switch is given to recurse. Before be254a0ea9 (Add the 'fetch.recurseSubmodules' config setting, 2010-11-11) we would not load the config unless the user asked for submodule action.
Then with the config switch we *had* to load the config (both .gitmodules as well as .git/config), so at that commit it would have made sense to inline this into the regular config and command line argument parsing.
Re: [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing
Quoted 12 lines · Stefan Beller
Quoted 11 lines
builtin/fetch.c int cmd_fetch(int argc, const char **argv, const char *prefix) · line 1340
Quoted 7 lines
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {builtin/fetch.c +2
-4-if (recurse_submodules_default) { -int arg =parse_fetch_recurse_submodules_arg ("--recurse-submodules-default" , recurse_submodules_default); -set_config_fetch_recurse_submodules (arg); - } +if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) +set_config_fetch_recurse_submodules (recurse_submodules_default);This is not a new thing, and it may not even be a problem, but I have to wonder why this needs to be done conditionally. "The
...
Quoted 8 lines
As far as I suspect, the original author considered evaluating the additional config too expensive.
gitmodules_config(); // <- this specifically? git_config(submodule_config, NULL);And that is why we only react if any switch is
given to recurse.
I am not talking about the outer "if" condition.
The inner
"if (recurse_submodules_default != RECURSE_SUBMODULES_DEFAULT)"
block, is what I am questioning, i.e. I am wondering why set_config_fetch_recurse_submodules() need to be conditionally called.
The two statement you quoted above will be executed either way, regardless of the value of recurse_submodule_default.
Unless --recurse-submodules=off is given, in which case the outer "if" condition rejects. And I think you are explaining that part, but that was not what I am questioning.
Re: [PATCH 2/3] builtin/fetch: parse recurse-submodules-default at default options parsing
Quoted 11 lines · Junio C Hamano
Quoted 8 lines
Quoted 8 lines
builtin/fetch.c int cmd_fetch(int argc, const char **argv, const char *prefix) · line 1340
Quoted 7 lines
if (recurse_submodules != RECURSE_SUBMODULES_OFF) {builtin/fetch.c +2
-4-if (recurse_submodules_default) { -int arg =parse_fetch_recurse_submodules_arg ("--recurse-submodules-default" , recurse_submodules_default); -set_config_fetch_recurse_submodules (arg); - } +if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) +set_config_fetch_recurse_submodules (recurse_submodules_default);
Quoted 1 line
I am not talking about the outer "if" condition.
I agree with your analysis, my answer was evasive.
I'll dig into the details why we do not set the default by default.
PATCH 1/1 builtin/fetch cleanup: always set default value for submodule recursing
The check for the default was introduced with 88a21979c5 (fetch/pull:
recurse into submodules when necessary, 2011-03-06), which replaced an older construct (builtin/fetchs own implementation of the super-prefix) introduced in be254a0ea9 (Add the 'fetch.recurseSubmodules' config setting, 2010-11-11) which made sense at the time as there was no default fetch option for submodules at the time.
Set builtin/fetch.c#recurse_submodules_default to the same value as submodule.c#config_fetch_recurse_submodules which is set via set_config_fetch_recurse_submodules, such that the condition for checking whether we have to set the default value becomes unnecessary.
---
This queues on top of origin/sb/pull-rebase-submodule,
and answers questions raised in the review of origin/sb/pull-rebase-submodule^.
I thought about just squashing these two patches, but they do different cleanups so I am personally fine with having them both.
I may squash them if further review of that series requires a resend of the whole series.
Thanks,
Stefan
builtin/fetch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
builtin/fetch.c +2 -3
@@ -49,7 +49,7 @@ static struct transport *gtransport;static struct transport *gsecondary;static const char *submodule_prefix ="" ;static int recurse_submodules =RECURSE_SUBMODULES_DEFAULT ; -static int recurse_submodules_default =RECURSE_SUBMODULES_DEFAULT ; +static int recurse_submodules_default =RECURSE_SUBMODULES_ON_DEMAND ;static int shown_url =0 ;static int refmap_alloc, refmap_nr;static const char **refmap_array;
@@ -1336,8 +1336,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix) deepen =1 ;if (recurse_submodules !=RECURSE_SUBMODULES_OFF ) { -if (recurse_submodules_default !=RECURSE_SUBMODULES_DEFAULT ) -set_config_fetch_recurse_submodules (recurse_submodules_default); +set_config_fetch_recurse_submodules (recurse_submodules_default);gitmodules_config ();git_config (submodule_config,NULL ); }
Signature · 1 line
2.13.1.519.gc4803e3bc3