{"thread":{"id":"52605","subject":"git submodule update strange output behavior.","startedAt":"2020-01-09T18:37:22Z","lastAt":"2020-01-11T11:00:34Z","messageCount":7,"participants":["Carlo Wood","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"389538","messageId":"20200109192040.46aaa01e@hikaru","threadId":"52605","inReplyTo":null,"subject":"git submodule update strange output behavior.","fromName":"Carlo Wood","fromEmail":"carlo@alinoe.com","sentAt":"2020-01-09T18:20:40Z","receivedAt":"2020-01-09T18:37:22Z","isPatch":false,"sender":{"key":"carlo@alinoe.com","avatar":"https://gravatar.com/avatar/f9ef6306f40295ad6047a49139a3e240d5c297092eafab3da2e34416ba1193d9?d=mp&s=160"},"body":"\nIn a project containing submodules, one of the submodules\ncontains a submodule itself, which in turn also contains\na submodule.\n\nOverview:\n\nproject/foobar  [submodule]\nproject/cwm4    [submodule]\nproject/evio    [submodule]\nproject/evio/protocol/matrixssl       [submodule]\nproject/evio/protocol/matrixssl/cwm4  [submodule]\n\n('protocol' is a normal subdirectory)\n\nRunning (with or without the --quiet),\n\n$ git submodule --quiet update --init --recursive --remote\nFetching submodule protocol/matrixssl\nFetching submodule protocol/matrixssl/cwm4\nFetching submodule cwm4\n\nThis is odd (a bug imho) because\n\n1) it seems to only print this fetching information for submodules inside submodules,\nnot for the top-level submodules.\n2) it even prints this when using --quiet\n3) it prints this every time (also when there is nothing more to fetch).\n\n-- \nCarlo Wood <carlo@alinoe.com>\n"},{"id":"389539","messageId":"xmqqtv54zcik.fsf@gitster-ct.c.googlers.com","threadId":"52605","inReplyTo":"20200109192040.46aaa01e@hikaru","subject":"Re: git submodule update strange output behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-09T18:54:27Z","receivedAt":"2020-01-09T18:54:35Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Wood <carlo@alinoe.com> writes:\n\n> In a project containing submodules, one of the submodules\n> contains a submodule itself, which in turn also contains\n> a submodule.\n>\n> Overview:\n>\n> project/foobar  [submodule]\n> project/cwm4    [submodule]\n> project/evio    [submodule]\n> project/evio/protocol/matrixssl       [submodule]\n> project/evio/protocol/matrixssl/cwm4  [submodule]\n>\n> ('protocol' is a normal subdirectory)\n>\n> Running (with or without the --quiet),\n>\n> $ git submodule --quiet update --init --recursive --remote\n> Fetching submodule protocol/matrixssl\n> Fetching submodule protocol/matrixssl/cwm4\n> Fetching submodule cwm4\n>\n> This is odd (a bug imho) because\n>\n> 1) it seems to only print this fetching information for submodules inside submodules,\n> not for the top-level submodules.\n> 2) it even prints this when using --quiet\n> 3) it prints this every time (also when there is nothing more to fetch).\n\n\nSounds like a symptom of (a) the top-level \"git submodule update\"\nknowing how to react to \"--quiet\" but (b) it forgets to pass down\nthe \"--quiet\" when it recursively runs \"git submodule update\" in its\nsubmodules?\n\n"},{"id":"389546","messageId":"xmqq8smgz9as.fsf@gitster-ct.c.googlers.com","threadId":"52605","inReplyTo":"xmqqtv54zcik.fsf@gitster-ct.c.googlers.com","subject":"Re: git submodule update strange output behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-09T20:03:55Z","receivedAt":"2020-01-09T20:04:08Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Carlo Wood <carlo@alinoe.com> writes:\n>\n>> In a project containing submodules, one of the submodules\n>> contains a submodule itself, which in turn also contains\n>> a submodule.\n>>\n>> Overview:\n>>\n>> project/foobar  [submodule]\n>> project/cwm4    [submodule]\n>> project/evio    [submodule]\n>> project/evio/protocol/matrixssl       [submodule]\n>> project/evio/protocol/matrixssl/cwm4  [submodule]\n>>\n>> ('protocol' is a normal subdirectory)\n>>\n>> Running (with or without the --quiet),\n>>\n>> $ git submodule --quiet update --init --recursive --remote\n>> Fetching submodule protocol/matrixssl\n>> Fetching submodule protocol/matrixssl/cwm4\n>> Fetching submodule cwm4\n>>\n>> This is odd (a bug imho) because\n>>\n>> 1) it seems to only print this fetching information for submodules inside submodules,\n>> not for the top-level submodules.\n>> 2) it even prints this when using --quiet\n>> 3) it prints this every time (also when there is nothing more to fetch).\n>\n>\n> Sounds like a symptom of (a) the top-level \"git submodule update\"\n> knowing how to react to \"--quiet\" but (b) it forgets to pass down\n> the \"--quiet\" when it recursively runs \"git submodule update\" in its\n> submodules?\n\nJust a shot in the dark.  Not even compile tested ;-)\n\n submodule.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/submodule.c b/submodule.c\nindex 9da7181321..535bb6bf04 100644\n--- a/submodule.c\n+++ b/submodule.c\n@@ -1454,11 +1454,12 @@ static int get_next_submodule(struct child_process *cp,\n \t\t\targv_array_pushv(&cp->args, spf->args.argv);\n \t\t\targv_array_push(&cp->args, default_argv);\n \t\t\targv_array_push(&cp->args, \"--submodule-prefix\");\n-\n \t\t\tstrbuf_addf(&submodule_prefix, \"%s%s/\",\n \t\t\t\t\t\t       spf->prefix,\n \t\t\t\t\t\t       task->sub->path);\n \t\t\targv_array_push(&cp->args, submodule_prefix.buf);\n+\t\t\tif (spf->quiet)\n+\t\t\t\targv_array_push(&cp->args, \"--quiet\");\n \n \t\t\tspf->count++;\n \t\t\t*task_cb = task;\n"},{"id":"389569","messageId":"20200110101040.00b93fa7@hikaru","threadId":"52605","inReplyTo":"xmqqtv54zcik.fsf@gitster-ct.c.googlers.com","subject":"Re: git submodule update strange output behavior.","fromName":"Carlo Wood","fromEmail":"carlo@alinoe.com","sentAt":"2020-01-10T09:10:40Z","receivedAt":"2020-01-10T09:10:44Z","isPatch":false,"sender":{"key":"carlo@alinoe.com","avatar":"https://gravatar.com/avatar/f9ef6306f40295ad6047a49139a3e240d5c297092eafab3da2e34416ba1193d9?d=mp&s=160"},"body":"That seems only part of the problem, but yes.\n\nIt is only part of the problem because without --quiet\nI get the same output; that is - the top-level is still\nquiet, but the submodules aren't. That is out of balance\nimho.\n\nOn Thu, 09 Jan 2020 10:54:27 -0800\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Carlo Wood <carlo@alinoe.com> writes:\n> \n> > In a project containing submodules, one of the submodules\n> > contains a submodule itself, which in turn also contains\n> > a submodule.\n> >\n> > Overview:\n> >\n> > project/foobar  [submodule]\n> > project/cwm4    [submodule]\n> > project/evio    [submodule]\n> > project/evio/protocol/matrixssl       [submodule]\n> > project/evio/protocol/matrixssl/cwm4  [submodule]\n> >\n> > ('protocol' is a normal subdirectory)\n> >\n> > Running (with or without the --quiet),\n> >\n> > $ git submodule --quiet update --init --recursive --remote\n> > Fetching submodule protocol/matrixssl\n> > Fetching submodule protocol/matrixssl/cwm4\n> > Fetching submodule cwm4\n> >\n> > This is odd (a bug imho) because\n> >\n> > 1) it seems to only print this fetching information for submodules\n> > inside submodules, not for the top-level submodules.\n> > 2) it even prints this when using --quiet\n> > 3) it prints this every time (also when there is nothing more to\n> > fetch).  \n> \n> \n> Sounds like a symptom of (a) the top-level \"git submodule update\"\n> knowing how to react to \"--quiet\" but (b) it forgets to pass down\n> the \"--quiet\" when it recursively runs \"git submodule update\" in its\n> submodules?\n> \n\n\n\n-- \nCarlo Wood <carlo@alinoe.com>\n"},{"id":"389570","messageId":"20200110101251.3b9f9332@hikaru","threadId":"52605","inReplyTo":"xmqq8smgz9as.fsf@gitster-ct.c.googlers.com","subject":"Re: git submodule update strange output behavior.","fromName":"Carlo Wood","fromEmail":"carlo@alinoe.com","sentAt":"2020-01-10T09:12:51Z","receivedAt":"2020-01-10T09:12:54Z","isPatch":false,"sender":{"key":"carlo@alinoe.com","avatar":"https://gravatar.com/avatar/f9ef6306f40295ad6047a49139a3e240d5c297092eafab3da2e34416ba1193d9?d=mp&s=160"},"body":"It seems to me that the other part of the problem is printing\nthis output for submodules when nothing (needed to be) is fetched.\n\nI haven't tested if output for the top-level is printed (without\n--quiet) when also there fetching is needed; is that even possible?\n\nOn Thu, 09 Jan 2020 12:03:55 -0800\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n> \n> > Carlo Wood <carlo@alinoe.com> writes:\n> >  \n> >> In a project containing submodules, one of the submodules\n> >> contains a submodule itself, which in turn also contains\n> >> a submodule.\n> >>\n> >> Overview:\n> >>\n> >> project/foobar  [submodule]\n> >> project/cwm4    [submodule]\n> >> project/evio    [submodule]\n> >> project/evio/protocol/matrixssl       [submodule]\n> >> project/evio/protocol/matrixssl/cwm4  [submodule]\n> >>\n> >> ('protocol' is a normal subdirectory)\n> >>\n> >> Running (with or without the --quiet),\n> >>\n> >> $ git submodule --quiet update --init --recursive --remote\n> >> Fetching submodule protocol/matrixssl\n> >> Fetching submodule protocol/matrixssl/cwm4\n> >> Fetching submodule cwm4\n> >>\n> >> This is odd (a bug imho) because\n> >>\n> >> 1) it seems to only print this fetching information for submodules\n> >> inside submodules, not for the top-level submodules.\n> >> 2) it even prints this when using --quiet\n> >> 3) it prints this every time (also when there is nothing more to\n> >> fetch).  \n> >\n> >\n> > Sounds like a symptom of (a) the top-level \"git submodule update\"\n> > knowing how to react to \"--quiet\" but (b) it forgets to pass down\n> > the \"--quiet\" when it recursively runs \"git submodule update\" in its\n> > submodules?  \n> \n> Just a shot in the dark.  Not even compile tested ;-)\n> \n>  submodule.c | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/submodule.c b/submodule.c\n> index 9da7181321..535bb6bf04 100644\n> --- a/submodule.c\n> +++ b/submodule.c\n> @@ -1454,11 +1454,12 @@ static int get_next_submodule(struct\n> child_process *cp, argv_array_pushv(&cp->args, spf->args.argv);\n>  \t\t\targv_array_push(&cp->args, default_argv);\n>  \t\t\targv_array_push(&cp->args,\n> \"--submodule-prefix\"); -\n>  \t\t\tstrbuf_addf(&submodule_prefix, \"%s%s/\",\n>  \t\t\t\t\t\t       spf->prefix,\n>  \t\t\t\t\t\t       task->sub->path);\n>  \t\t\targv_array_push(&cp->args,\n> submodule_prefix.buf);\n> +\t\t\tif (spf->quiet)\n> +\t\t\t\targv_array_push(&cp->args,\n> \"--quiet\"); \n>  \t\t\tspf->count++;\n>  \t\t\t*task_cb = task;\n\n\n\n-- \nCarlo Wood <carlo@alinoe.com>\n"},{"id":"389592","messageId":"xmqqblrbm7c9.fsf@gitster-ct.c.googlers.com","threadId":"52605","inReplyTo":"20200110101251.3b9f9332@hikaru","subject":"Re: git submodule update strange output behavior.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-10T19:36:54Z","receivedAt":"2020-01-10T19:36:58Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Carlo Wood <carlo@alinoe.com> writes:\n\n> It seems to me that the other part of the problem is printing\n> this output for submodules when nothing (needed to be) is fetched.\n\nHmm, I am not sure if that is a reasonable expectation.  Would it be\npossible to tell if there is something that needs to be fetched\nwithout attempting to contact the other side?\n"},{"id":"389607","messageId":"20200111120029.2baaa090@hikaru","threadId":"52605","inReplyTo":"xmqqblrbm7c9.fsf@gitster-ct.c.googlers.com","subject":"Re: git submodule update strange output behavior.","fromName":"Carlo Wood","fromEmail":"carlo@alinoe.com","sentAt":"2020-01-11T11:00:29Z","receivedAt":"2020-01-11T11:00:34Z","isPatch":false,"sender":{"key":"carlo@alinoe.com","avatar":"https://gravatar.com/avatar/f9ef6306f40295ad6047a49139a3e240d5c297092eafab3da2e34416ba1193d9?d=mp&s=160"},"body":"On Fri, 10 Jan 2020 11:36:54 -0800\nJunio C Hamano <gitster@pobox.com> wrote:\n\n> Carlo Wood <carlo@alinoe.com> writes:\n> \n> > It seems to me that the other part of the problem is printing\n> > this output for submodules when nothing (needed to be) is fetched.  \n> \n> Hmm, I am not sure if that is a reasonable expectation.  Would it be\n> possible to tell if there is something that needs to be fetched\n> without attempting to contact the other side?\n\nThat wasn't even my point though: assume that we can't know, so we\nhave to attempt a fetch anyway (seems indeed likely), then I'd\nexpect to see this message for *every* submodule, and not just\nfor submodules inside other submodule.\n\nThere is an asymmetry (in the output of this command) between\nsubmodules in the top level project and submodules inside other\nsubmodules.\n\nThis then makes me wonder after all, if the message is suppressed for\ntop-level submodules then can't it also be suppressed for the others\n(those that are currently being printed)?\n\n-- \nCarlo Wood <carlo@alinoe.com>\n"}]}