Re: git submodule update strange output behavior.
- From
Carlo Wood <carlo@alinoe.com>
- Date
- Jan 10, 2020, 09:12 UTC
- Message-ID
- <20200110101251.3b9f9332@hikaru>
- In-Reply-To
- <xmqq8smgz9as.fsf@gitster-ct.c.googlers.com>
It seems to me that the other part of the problem is printing this output for submodules when nothing (needed to be) is fetched.
I haven't tested if output for the top-level is printed (without --quiet) when also there fetching is needed; is that even possible?
On Thu, 09 Jan 2020 12:03:55 -0800 Junio C Hamano <gitster@pobox.com> wrote:
Show 63 quoted lines
> 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;-- Carlo Wood <carlo@alinoe.com>