{"thread":{"id":"44879","subject":"[PATCH] submodule update: run custom update script for initial populating as well","startedAt":"2017-01-13T19:43:37Z","lastAt":"2017-01-25T23:49:02Z","messageCount":8,"participants":["Stefan Beller","Junio C Hamano","Brandon Williams"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"309388","messageId":"20170113194326.13950-1-sbeller@google.com","threadId":"44879","inReplyTo":null,"subject":"[PATCH] submodule update: run custom update script for initial populating as well","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-01-13T19:43:26Z","receivedAt":"2017-01-13T19:43:37Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n2011-02-17), all actions were defaulted to checkout for populating\na submodule initially, because merging or rebasing makes no sense\nin that situation.\n\nOther commands however do make sense, such as the custom command\nthat was added later (6cb5728c43, submodule update: allow custom\ncommand to update submodule working tree, 2013-07-03).\n\nI am unsure about the \"none\" command, as I can see an initial\ncheckout there as a useful thing. On the other hand going strictly\nby our own documentation, we should do nothing in case of \"none\"\nas well, because the user asked for it.\n\nReported-by: Han-Wen Nienhuys <hanwen@google.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n git-submodule.sh            |  7 ++++++-\n t/t7406-submodule-update.sh | 15 +++++++++++++++\n 2 files changed, 21 insertions(+), 1 deletion(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 554bd1c494..aeb721ab7e 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -606,7 +606,12 @@ cmd_update()\n \t\tif test $just_cloned -eq 1\n \t\tthen\n \t\t\tsubsha1=\n-\t\t\tupdate_module=checkout\n+\t\t\tif test \"$update_module\" = \"merge\" ||\n+\t\t\t   test \"$update_module\" = \"rebase\" ||\n+\t\t\t   test \"$update_module\" = \"none\"\n+\t\t\tthen\n+\t\t\t\tupdate_module=checkout\n+\t\t\tfi\n \t\telse\n \t\t\tsubsha1=$(sanitize_submodule_env; cd \"$sm_path\" &&\n \t\t\t\tgit rev-parse --verify HEAD) ||\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 64f322c4cc..1407fa6098 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -424,6 +424,19 @@ test_expect_success 'submodule update - command in .git/config catches failure -\n \ttest_i18ncmp actual expect\n '\n \n+test_expect_success 'submodule update - command run for initial population of submodule' '\n+\tcat <<-\\ EOF >expect\n+\tExecution of '\\''false $submodulesha1'\\'' failed in submodule path '\\''submodule'\\''\n+\tEOF\n+\t(\n+\t\tcd super &&\n+\t\trm -rf submodule\n+\t\ttest_must_fail git submodule update >../actual\n+\t)\n+\ttest_cmp expect actual\n+\tgit -C super submodule update --checkout\n+'\n+\n cat << EOF >expect\n Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'\n Failed to recurse into submodule path '../super'\n@@ -476,6 +489,7 @@ test_expect_success 'submodule init picks up merge' '\n '\n \n test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n@@ -488,6 +502,7 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod\n '\n \n test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n-- \n2.11.0.300.g08194d1431.dirty\n\n"},{"id":"309403","messageId":"xmqqfukmedca.fsf@gitster.mtv.corp.google.com","threadId":"44879","inReplyTo":"20170113194326.13950-1-sbeller@google.com","subject":"Re: [PATCH] submodule update: run custom update script for initial populating as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-13T23:42:45Z","receivedAt":"2017-01-13T23:42:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n> 2011-02-17), all actions were defaulted to checkout for populating\n> a submodule initially, because merging or rebasing makes no sense\n> in that situation.\n>\n> Other commands however do make sense, such as the custom command\n> that was added later (6cb5728c43, submodule update: allow custom\n> command to update submodule working tree, 2013-07-03).\n\nMakes sense.\n\n> I am unsure about the \"none\" command, as I can see an initial\n> checkout there as a useful thing. On the other hand going strictly\n> by our own documentation, we should do nothing in case of \"none\"\n> as well, because the user asked for it.\n\nI think \"none\" is \"I'll decide which revision of the submodule\nshould be there---do not decide it for me\".  If the user is\nexplicitly saying with \"git submodule init\" to have \"some\" version,\nand if the user did not have any (because the user didn't show\ninterest in any checkout of the submodule before), then I think it\nprobably makes more sense to checkout the version bound to the\nsuperproject, than leaving the directory empty.\n\n> Reported-by: Han-Wen Nienhuys <hanwen@google.com>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>  git-submodule.sh            |  7 ++++++-\n>  t/t7406-submodule-update.sh | 15 +++++++++++++++\n>  2 files changed, 21 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 554bd1c494..aeb721ab7e 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -606,7 +606,12 @@ cmd_update()\n>  \t\tif test $just_cloned -eq 1\n>  \t\tthen\n>  \t\t\tsubsha1=\n> -\t\t\tupdate_module=checkout\n> +\t\t\tif test \"$update_module\" = \"merge\" ||\n> +\t\t\t   test \"$update_module\" = \"rebase\" ||\n> +\t\t\t   test \"$update_module\" = \"none\"\n> +\t\t\tthen\n> +\t\t\t\tupdate_module=checkout\n> +\t\t\tfi\n\n... which seems to be what you did.  Do we need a documentation\nupdate, or does this just make the behaviour of this corner case\nconsistent with what is already documented?\n\nThanks.\n"},{"id":"309404","messageId":"CAGZ79kYg=nJ8EqBEhoiWm2XRh3_3AuL7Qw-dCSKZqPO6CjFFwg@mail.gmail.com","threadId":"44879","inReplyTo":"xmqqfukmedca.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] submodule update: run custom update script for initial populating as well","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-01-13T23:52:21Z","receivedAt":"2017-01-13T23:52:27Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jan 13, 2017 at 3:42 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stefan Beller <sbeller@google.com> writes:\n>\n>> In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n>> 2011-02-17), all actions were defaulted to checkout for populating\n>> a submodule initially, because merging or rebasing makes no sense\n>> in that situation.\n>>\n>> Other commands however do make sense, such as the custom command\n>> that was added later (6cb5728c43, submodule update: allow custom\n>> command to update submodule working tree, 2013-07-03).\n>\n> Makes sense.\n>\n>> I am unsure about the \"none\" command, as I can see an initial\n>> checkout there as a useful thing. On the other hand going strictly\n>> by our own documentation, we should do nothing in case of \"none\"\n>> as well, because the user asked for it.\n>\n> I think \"none\" is \"I'll decide which revision of the submodule\n> should be there---do not decide it for me\".  If the user is\n> explicitly saying with \"git submodule init\" to have \"some\" version,\n> and if the user did not have any (because the user didn't show\n> interest in any checkout of the submodule before), then I think it\n> probably makes more sense to checkout the version bound to the\n> superproject, than leaving the directory empty.\n>\n>> Reported-by: Han-Wen Nienhuys <hanwen@google.com>\n>> Signed-off-by: Stefan Beller <sbeller@google.com>\n>> ---\n>>  git-submodule.sh            |  7 ++++++-\n>>  t/t7406-submodule-update.sh | 15 +++++++++++++++\n>>  2 files changed, 21 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/git-submodule.sh b/git-submodule.sh\n>> index 554bd1c494..aeb721ab7e 100755\n>> --- a/git-submodule.sh\n>> +++ b/git-submodule.sh\n>> @@ -606,7 +606,12 @@ cmd_update()\n>>               if test $just_cloned -eq 1\n>>               then\n>>                       subsha1=\n>> -                     update_module=checkout\n>> +                     if test \"$update_module\" = \"merge\" ||\n>> +                        test \"$update_module\" = \"rebase\" ||\n>> +                        test \"$update_module\" = \"none\"\n>> +                     then\n>> +                             update_module=checkout\n>> +                     fi\n>\n> ... which seems to be what you did.  Do we need a documentation\n> update, or does this just make the behaviour of this corner case\n> consistent with what is already documented?\n\nI think we do not need to update the documentation, because the\ndocumentation doesn't call out the first/initial call to update to be special.\nSo for a non existing submodule we can do:\n\n    git submodule update --init --[rebase|merge]\n\nand that falls back to checkout, which *looks* like it was a rebase/merge.\nThe original bug report was that\n\n    $ git config submodule.<name>.update !echo-script.sh\n    $ git submodule update <submodule>\n    Submodule path '<submodule>': 'echo-script.sh'\n    $ rm -rf <submodule>\n    $ git submodule update <submodule>\n    .. checked out ..\n\nSo while I usually think more verbose documentation is a good idea,\nthis time it's different, as it merely aligns current documented\nbehavior with reality.\n\nThanks,\nStefan\n"},{"id":"309407","messageId":"xmqq7f5yeclw.fsf@gitster.mtv.corp.google.com","threadId":"44879","inReplyTo":"20170113194326.13950-1-sbeller@google.com","subject":"Re: [PATCH] submodule update: run custom update script for initial populating as well","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-13T23:58:35Z","receivedAt":"2017-01-13T23:58:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> +\t\t\tif test \"$update_module\" = \"merge\" ||\n> +\t\t\t   test \"$update_module\" = \"rebase\" ||\n> +\t\t\t   test \"$update_module\" = \"none\"\n> +\t\t\tthen\n> +\t\t\t\tupdate_module=checkout\n> +\t\t\tfi\n\n\tcase \"$update_module\" in\n\tmerge | rebase | none)\n\t\tupdate_module=checkout ;;\n\tesac\n\nShorter and probably easier to update.\n"},{"id":"309408","messageId":"CAGZ79kbi-cweTe-ydcRYFFnGT4EmN+O1TZDiGYFyg8-Ex8abUw@mail.gmail.com","threadId":"44879","inReplyTo":"xmqq7f5yeclw.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] submodule update: run custom update script for initial populating as well","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-01-14T00:00:07Z","receivedAt":"2017-01-14T00:00:13Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Fri, Jan 13, 2017 at 3:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Stefan Beller <sbeller@google.com> writes:\n>\n>> +                     if test \"$update_module\" = \"merge\" ||\n>> +                        test \"$update_module\" = \"rebase\" ||\n>> +                        test \"$update_module\" = \"none\"\n>> +                     then\n>> +                             update_module=checkout\n>> +                     fi\n>\n>         case \"$update_module\" in\n>         merge | rebase | none)\n>                 update_module=checkout ;;\n>         esac\n>\n> Shorter and probably easier to update.\n\nagreed, want me to reroll or squash locally?\n\nThanks,\nStefan\n"},{"id":"310263","messageId":"20170125233742.30370-1-sbeller@google.com","threadId":"44879","inReplyTo":"CAGZ79kbi-cweTe-ydcRYFFnGT4EmN+O1TZDiGYFyg8-Ex8abUw@mail.gmail.com","subject":"[PATCHv2] submodule update: run custom update script for initial populating as well","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-01-25T23:37:42Z","receivedAt":"2017-01-25T23:37:58Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n2011-02-17), all actions were defaulted to checkout for populating\na submodule initially, because merging or rebasing makes no sense\nin that situation.\n\nOther commands however do make sense, such as the custom command\nthat was added later (6cb5728c43, submodule update: allow custom\ncommand to update submodule working tree, 2013-07-03).\n\nI am unsure about the \"none\" command, as I can see an initial\ncheckout there as a useful thing. On the other hand going strictly\nby our own documentation, we should do nothing in case of \"none\"\nas well, because the user asked for it.\n\nReported-by: Han-Wen Nienhuys <hanwen@google.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n git-submodule.sh            |  5 ++++-\n t/t7406-submodule-update.sh | 15 +++++++++++++++\n 2 files changed, 19 insertions(+), 1 deletion(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 9788175979..63fc4fe9bc 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -607,7 +607,10 @@ cmd_update()\n \t\tif test $just_cloned -eq 1\n \t\tthen\n \t\t\tsubsha1=\n-\t\t\tupdate_module=checkout\n+\t\t\tcase \"$update_module\" in\n+\t\t\tmerge | rebase | none)\n+\t\t\t\tupdate_module=checkout ;;\n+\t\t\tesac\n \t\telse\n \t\t\tsubsha1=$(sanitize_submodule_env; cd \"$sm_path\" &&\n \t\t\t\tgit rev-parse --verify HEAD) ||\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 725bbed1f8..2f83243c7d 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -441,6 +441,19 @@ test_expect_success 'submodule update - command in .git/config catches failure -\n \ttest_i18ncmp actual expect\n '\n \n+test_expect_success 'submodule update - command run for initial population of submodule' '\n+\tcat <<-\\ EOF >expect\n+\tExecution of '\\''false $submodulesha1'\\'' failed in submodule path '\\''submodule'\\''\n+\tEOF\n+\t(\n+\t\tcd super &&\n+\t\trm -rf submodule\n+\t\ttest_must_fail git submodule update >../actual\n+\t)\n+\ttest_cmp expect actual\n+\tgit -C super submodule update --checkout\n+'\n+\n cat << EOF >expect\n Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'\n Failed to recurse into submodule path '../super'\n@@ -493,6 +506,7 @@ test_expect_success 'submodule init picks up merge' '\n '\n \n test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n@@ -505,6 +519,7 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod\n '\n \n test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n-- \n2.11.0.495.g04f60290a0.dirty\n\n"},{"id":"310267","messageId":"20170125234158.GE83343@google.com","threadId":"44879","inReplyTo":"20170125233742.30370-1-sbeller@google.com","subject":"Re: [PATCHv2] submodule update: run custom update script for initial populating as well","fromName":"Brandon Williams","fromEmail":"bmwill@google.com","sentAt":"2017-01-25T23:41:58Z","receivedAt":"2017-01-25T23:42:06Z","isPatch":false,"sender":{"key":"bwilliams.eng@gmail.com","avatar":null},"body":"On 01/25, Stefan Beller wrote:\n> In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n> 2011-02-17), all actions were defaulted to checkout for populating\n> a submodule initially, because merging or rebasing makes no sense\n> in that situation.\n> \n> Other commands however do make sense, such as the custom command\n> that was added later (6cb5728c43, submodule update: allow custom\n> command to update submodule working tree, 2013-07-03).\n> \n> I am unsure about the \"none\" command, as I can see an initial\n> checkout there as a useful thing. On the other hand going strictly\n> by our own documentation, we should do nothing in case of \"none\"\n> as well, because the user asked for it.\n> \n> Reported-by: Han-Wen Nienhuys <hanwen@google.com>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>  git-submodule.sh            |  5 ++++-\n>  t/t7406-submodule-update.sh | 15 +++++++++++++++\n>  2 files changed, 19 insertions(+), 1 deletion(-)\n> \n> diff --git a/git-submodule.sh b/git-submodule.sh\n> index 9788175979..63fc4fe9bc 100755\n> --- a/git-submodule.sh\n> +++ b/git-submodule.sh\n> @@ -607,7 +607,10 @@ cmd_update()\n>  \t\tif test $just_cloned -eq 1\n>  \t\tthen\n>  \t\t\tsubsha1=\n> -\t\t\tupdate_module=checkout\n> +\t\t\tcase \"$update_module\" in\n> +\t\t\tmerge | rebase | none)\n> +\t\t\t\tupdate_module=checkout ;;\n> +\t\t\tesac\n>  \t\telse\n>  \t\t\tsubsha1=$(sanitize_submodule_env; cd \"$sm_path\" &&\n>  \t\t\t\tgit rev-parse --verify HEAD) ||\n> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\n> index 725bbed1f8..2f83243c7d 100755\n> --- a/t/t7406-submodule-update.sh\n> +++ b/t/t7406-submodule-update.sh\n> @@ -441,6 +441,19 @@ test_expect_success 'submodule update - command in .git/config catches failure -\n>  \ttest_i18ncmp actual expect\n>  '\n>  \n> +test_expect_success 'submodule update - command run for initial population of submodule' '\n> +\tcat <<-\\ EOF >expect\n> +\tExecution of '\\''false $submodulesha1'\\'' failed in submodule path '\\''submodule'\\''\n> +\tEOF\n> +\t(\n> +\t\tcd super &&\n> +\t\trm -rf submodule\n> +\t\ttest_must_fail git submodule update >../actual\n> +\t)\n> +\ttest_cmp expect actual\n> +\tgit -C super submodule update --checkout\n> +'\n\nYou can probably get away without the subshell:\n\nrm -rf super/submodule\ntest_must_fail git -C super submodule upsate >actual\n\n> +\n>  cat << EOF >expect\n>  Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'\n>  Failed to recurse into submodule path '../super'\n> @@ -493,6 +506,7 @@ test_expect_success 'submodule init picks up merge' '\n>  '\n>  \n>  test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '\n> +\ttest_config -C super submodule.submodule.update checkout &&\n>  \t(cd super &&\n>  \t rm -rf submodule &&\n>  \t git submodule update submodule &&\n> @@ -505,6 +519,7 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod\n>  '\n>  \n>  test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '\n> +\ttest_config -C super submodule.submodule.update checkout &&\n>  \t(cd super &&\n>  \t rm -rf submodule &&\n>  \t git submodule update submodule &&\n> -- \n> 2.11.0.495.g04f60290a0.dirty\n> \n\n-- \nBrandon Williams\n"},{"id":"310269","messageId":"20170125234851.22644-1-sbeller@google.com","threadId":"44879","inReplyTo":"20170125234158.GE83343@google.com","subject":"[PATCHv3] submodule update: run custom update script for initial populating as well","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2017-01-25T23:48:51Z","receivedAt":"2017-01-25T23:49:02Z","isPatch":false,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"In 1b4735d9f3 (submodule: no [--merge|--rebase] when newly cloned,\n2011-02-17), all actions were defaulted to checkout for populating\na submodule initially, because merging or rebasing makes no sense\nin that situation.\n\nOther commands however do make sense, such as the custom command\nthat was added later (6cb5728c43, submodule update: allow custom\ncommand to update submodule working tree, 2013-07-03).\n\nI am unsure about the \"none\" command, as I can see an initial\ncheckout there as a useful thing. On the other hand going strictly\nby our own documentation, we should do nothing in case of \"none\"\nas well, because the user asked for it.\n\nReported-by: Han-Wen Nienhuys <hanwen@google.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n\n Thanks, Brandon, for spotting the unneeded subshell.\n I also fixed the && chaining along the way.\n \n Thanks,\n Stefan\n\n git-submodule.sh            |  5 ++++-\n t/t7406-submodule-update.sh | 12 ++++++++++++\n 2 files changed, 16 insertions(+), 1 deletion(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex 9788175979..63fc4fe9bc 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -607,7 +607,10 @@ cmd_update()\n \t\tif test $just_cloned -eq 1\n \t\tthen\n \t\t\tsubsha1=\n-\t\t\tupdate_module=checkout\n+\t\t\tcase \"$update_module\" in\n+\t\t\tmerge | rebase | none)\n+\t\t\t\tupdate_module=checkout ;;\n+\t\t\tesac\n \t\telse\n \t\t\tsubsha1=$(sanitize_submodule_env; cd \"$sm_path\" &&\n \t\t\t\tgit rev-parse --verify HEAD) ||\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex 725bbed1f8..347857fa7c 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -441,6 +441,16 @@ test_expect_success 'submodule update - command in .git/config catches failure -\n \ttest_i18ncmp actual expect\n '\n \n+test_expect_success 'submodule update - command run for initial population of submodule' '\n+\tcat <<-\\ EOF >expect\n+\tExecution of '\\''false $submodulesha1'\\'' failed in submodule path '\\''submodule'\\''\n+\tEOF &&\n+\trm -rf super/submodule &&\n+\ttest_must_fail git -C super submodule update >../actual &&\n+\ttest_cmp expect actual &&\n+\tgit -C super submodule update --checkout\n+'\n+\n cat << EOF >expect\n Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'\n Failed to recurse into submodule path '../super'\n@@ -493,6 +503,7 @@ test_expect_success 'submodule init picks up merge' '\n '\n \n test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n@@ -505,6 +516,7 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod\n '\n \n test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '\n+\ttest_config -C super submodule.submodule.update checkout &&\n \t(cd super &&\n \t rm -rf submodule &&\n \t git submodule update submodule &&\n-- \n2.11.0.495.g04f60290a0.dirty\n\n"}]}