git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule: do no re-read name in shell script

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jul 21, 2016, 01:00 UTC
Message-ID
<20160721010029.GG29326@google.com>
In-Reply-To
<20160721005122.15966-1-sbeller@google.com>
Stefan Beller wrote:
Show 22 quoted lines
> Instead of making another call to a submodule helper (name), just
> propagate the value when we know it (in the update-clone helper) already.
>
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
>  builtin/submodule--helper.c | 4 ++--
>  git-submodule.sh            | 3 +--
>  2 files changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
> index b22352b..494e088 100644
> --- a/builtin/submodule--helper.c
> +++ b/builtin/submodule--helper.c
> @@ -683,9 +683,9 @@ static int prepare_to_clone_next_submodule(const struct cache_entry *ce,
>  	needs_cloning = !file_exists(sb.buf);
> 
>  	strbuf_reset(&sb);
> -	strbuf_addf(&sb, "%06o %s %d %d\t%s\n", ce->ce_mode,
> +	strbuf_addf(&sb, "%06o %s %d %d %s\t%s\n", ce->ce_mode,
>  			sha1_to_hex(ce->sha1), ce_stage(ce),
> -			needs_cloning, ce->name);
> +			needs_cloning, sub->name, sub->path);

Are there any restrictions on what characters a submodule name can contain? Does this need e.g. to be quoted with sq_quote?

Thanks, Jonathan

Previous: Stefan BellerNext: Stefan Beller
Message 2 of 3 in “submodule: do no re-read name in shell script”
  1. submodule: do no re-read name in shell scriptStefan Beller, Jul 21, 2016
  2. Jonathan NiederJul 21, 2016
  3. Stefan BellerJul 21, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.