git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Kevin Ballard <kevin@sb.org>, Jon Seymour <jon.seymour@gmail.com>,
	Chris Packham <judge.packham@gmail.com>,
	Marc Branchaud <marcnarc@xiplink.com>
Subject: Re: [PATCH v4 1/3] fetch/pull: Add the --recurse-submodules option
Date: Fri, 10 Dec 2010 00:07:50 +0100	[thread overview]
Message-ID: <4D016146.9010907@web.de> (raw)
In-Reply-To: <7vei9qfxzy.fsf@alter.siamese.dyndns.org>

Am 09.12.2010 22:16, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> Until now you had to call "git submodule update" (without -N|--no-fetch
>> option) or something like "git submodule foreach git fetch" to fetch
>> new commits in populated submodules from their remote.
>> ...
>> diff --git a/builtin/fetch.c b/builtin/fetch.c
>> index d35f000..db3fba3 100644
>> --- a/builtin/fetch.c
>> +++ b/builtin/fetch.c
>> ...
>> @@ -784,28 +790,36 @@ static int add_remote_or_group(const char *name, struct string_list *list)
>>  	return 1;
>>  }
>>
>> -static int fetch_multiple(struct string_list *list)
>> +static void add_options_to_argv(int *argc, const char **argv)
>>  {
>> -	int i, result = 0;
>> -	const char *argv[11] = { "fetch", "--append" };
>> -...
>> +static int fetch_multiple(struct string_list *list)
>> +{
>> +	int i, result = 0;
>> +	const char *argv[12] = { "fetch", "--append" };
> 
> This used to be 11; are we adding something new?  Ahh, possibly
> "--recurse_submodules".

Yup, that's why! (see a few lines down between "--keep" and "-v").

>> diff --git a/submodule.c b/submodule.c
>> index 91a4758..4d9b774 100644
>> --- a/submodule.c
>> +++ b/submodule.c
>> @@ -63,7 +63,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
>>  	}
>>  }
>>
>> -static int submodule_config(const char *var, const char *value, void *cb)
>> +int submodule_config(const char *var, const char *value, void *cb)
>>  {
>>  	if (!prefixcmp(var, "submodule."))
>>  		return parse_submodule_config_option(var, value);
>> @@ -229,6 +229,70 @@ void show_submodule_summary(FILE *f, const char *path,
>>  	strbuf_release(&sb);
>>  }
>>
>> +int fetch_populated_submodules(int num_options, const char **options,
>> +			       const char *prefix, int quiet)
>> +{
>> +	int i, result = 0, argc = 0;
>> +	struct child_process cp;
>> +	const char **argv;
>> +	struct string_list_item *name_for_path;
>> +	const char *work_tree = get_git_work_tree();
>> +	if (!work_tree)
>> +		return 0;
>> +
>> +	if (!the_index.initialized)
>> +		if (read_cache() < 0)
>> +			die("index file corrupt");
>> +
>> +	argv = xcalloc(num_options + 5, sizeof(const char *));
> 
> Where is this '5' coming from?  "fetch" "--submodule-prefix", the prefix,
> and the terminating NULL?  What did I miss?

No, you didn't miss anything but I have been off by one ... '4' is
sufficient here.

  reply	other threads:[~2010-12-09 23:08 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-10 23:53 [PATCH v3 0/3] Teach fetch and pull to recursively fetch submodules Jens Lehmann
2010-11-10 23:54 ` [PATCH v3 1/3] fetch/pull: Add the --recurse-submodules option Jens Lehmann
2010-11-10 23:55 ` [PATCH v3 2/3] Add the 'fetch.recurseSubmodules' config setting Jens Lehmann
2010-11-11  0:02   ` Jonathan Nieder
2010-11-11  8:14     ` Jens Lehmann
2010-11-11  8:27       ` Jonathan Nieder
2010-11-11 18:31         ` Junio C Hamano
2010-11-11 19:00           ` Jonathan Nieder
2010-11-12 11:54             ` Jens Lehmann
2010-11-12 15:52               ` Jonathan Nieder
2010-11-12 19:48                 ` Jens Lehmann
2010-11-12 20:16                   ` Jonathan Nieder
2010-11-12 21:58                     ` Jens Lehmann
2010-11-12 11:40           ` Jens Lehmann
2010-11-10 23:55 ` [PATCH v3 3/3] Submodules: Add the "fetchRecurseSubmodules" config option Jens Lehmann
2010-11-11  0:05 ` [PATCH v3 0/3] Teach fetch and pull to recursively fetch submodules Jonathan Nieder
2010-11-11  8:18   ` Jens Lehmann
2010-11-12 12:54   ` [PATCH v4 1/3] fetch/pull: Add the --recurse-submodules option Jens Lehmann
2010-11-12 19:54     ` Jonathan Nieder
2010-11-12 20:22       ` Jens Lehmann
2010-12-09 21:16     ` Junio C Hamano
2010-12-09 23:07       ` Jens Lehmann [this message]
2010-12-10 17:30         ` Junio C Hamano
2010-12-10 18:03           ` Jens Lehmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D016146.9010907@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jon.seymour@gmail.com \
    --cc=jrnieder@gmail.com \
    --cc=judge.packham@gmail.com \
    --cc=kevin@sb.org \
    --cc=marcnarc@xiplink.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).