git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Carlo Wood <carlo@alinoe.com>
Cc: git@vger.kernel.org
Subject: Re: git submodule update  strange output behavior.
Date: Thu, 09 Jan 2020 12:03:55 -0800	[thread overview]
Message-ID: <xmqq8smgz9as.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <xmqqtv54zcik.fsf@gitster-ct.c.googlers.com> (Junio C. Hamano's message of "Thu, 09 Jan 2020 10:54:27 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> Carlo Wood <carlo@alinoe.com> writes:
>
>> In a project containing submodules, one of the submodules
>> contains a submodule itself, which in turn also contains
>> a submodule.
>>
>> Overview:
>>
>> project/foobar  [submodule]
>> project/cwm4    [submodule]
>> project/evio    [submodule]
>> project/evio/protocol/matrixssl       [submodule]
>> project/evio/protocol/matrixssl/cwm4  [submodule]
>>
>> ('protocol' is a normal subdirectory)
>>
>> Running (with or without the --quiet),
>>
>> $ git submodule --quiet update --init --recursive --remote
>> Fetching submodule protocol/matrixssl
>> Fetching submodule protocol/matrixssl/cwm4
>> Fetching submodule cwm4
>>
>> This is odd (a bug imho) because
>>
>> 1) it seems to only print this fetching information for submodules inside submodules,
>> not for the top-level submodules.
>> 2) it even prints this when using --quiet
>> 3) it prints this every time (also when there is nothing more to fetch).
>
>
> Sounds like a symptom of (a) the top-level "git submodule update"
> knowing how to react to "--quiet" but (b) it forgets to pass down
> the "--quiet" when it recursively runs "git submodule update" in its
> submodules?

Just a shot in the dark.  Not even compile tested ;-)

 submodule.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/submodule.c b/submodule.c
index 9da7181321..535bb6bf04 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1454,11 +1454,12 @@ static int get_next_submodule(struct child_process *cp,
 			argv_array_pushv(&cp->args, spf->args.argv);
 			argv_array_push(&cp->args, default_argv);
 			argv_array_push(&cp->args, "--submodule-prefix");
-
 			strbuf_addf(&submodule_prefix, "%s%s/",
 						       spf->prefix,
 						       task->sub->path);
 			argv_array_push(&cp->args, submodule_prefix.buf);
+			if (spf->quiet)
+				argv_array_push(&cp->args, "--quiet");
 
 			spf->count++;
 			*task_cb = task;

  reply	other threads:[~2020-01-09 20:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 18:20 git submodule update strange output behavior Carlo Wood
2020-01-09 18:54 ` Junio C Hamano
2020-01-09 20:03   ` Junio C Hamano [this message]
2020-01-10  9:12     ` Carlo Wood
2020-01-10 19:36       ` Junio C Hamano
2020-01-11 11:00         ` Carlo Wood
2020-01-10  9:10   ` Carlo Wood

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=xmqq8smgz9as.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=carlo@alinoe.com \
    --cc=git@vger.kernel.org \
    /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).