{"thread":{"id":"58740","subject":"[PATCH] documentation: update git-submodule documentation","startedAt":"2022-11-03T10:26:41Z","lastAt":"2022-11-04T11:25:55Z","messageCount":3,"participants":["James via GitGitGadget","Ævar Arnfjörð Bjarmason","James McCandlish"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"466395","messageId":"pull.1401.git.1667471194097.gitgitgadget@gmail.com","threadId":"58740","inReplyTo":null,"subject":"[PATCH] documentation: update git-submodule documentation","fromName":"James via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2022-11-03T10:26:33Z","receivedAt":"2022-11-03T10:26:41Z","isPatch":true,"sender":{"key":"purpleidea@gmail.com","avatar":"https://gravatar.com/avatar/161941d0314aee3803e1012aa5dedb2403ed9dcd00ec769bce81435493abe18d?d=mp&s=160"},"body":"From: James <jdm12989@gmail.com>\n\nRemoves reference to custom code execution which is called out by\ngitmodules as not allowed.\n\nSigned-off-by: James <jdm12989@gmail.com>\n---\n    Update git-submodule.txt\n    \n    Remove info about custom commands being allowed in the submodule update\n    command to align with the gitmodules docs which states \"For security\n    reasons, the !command form is not accepted here.\"\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-1401%2FEnochPrime%2Fsubmodule-docs-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1401/EnochPrime/submodule-docs-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/1401\n\n Documentation/git-submodule.txt | 6 ------\n 1 file changed, 6 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 4d3ab6b9f92..b40ac72f753 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -163,12 +163,6 @@ checked out in the submodule.\n The following 'update' procedures are only available via the\n `submodule.<name>.update` configuration variable:\n \n-\tcustom command;; arbitrary shell command that takes a single\n-\t    argument (the sha1 of the commit recorded in the\n-\t    superproject) is executed. When `submodule.<name>.update`\n-\t    is set to '!command', the remainder after the exclamation mark\n-\t    is the custom command.\n-\n \tnone;; the submodule is not updated.\n \n If the submodule is not yet initialized, and you just want to use the\n\nbase-commit: c03801e19cb8ab36e9c0d17ff3d5e0c3b0f24193\n-- \ngitgitgadget\n"},{"id":"466399","messageId":"221103.86eduk1bcw.gmgdl@evledraar.gmail.com","threadId":"58740","inReplyTo":"pull.1401.git.1667471194097.gitgitgadget@gmail.com","subject":"Re: [PATCH] documentation: update git-submodule documentation","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2022-11-03T12:14:38Z","receivedAt":"2022-11-03T12:17:10Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, Nov 03 2022, James via GitGitGadget wrote:\n\n> From: James <jdm12989@gmail.com>\n>\n> Removes reference to custom code execution which is called out by\n> gitmodules as not allowed.\n>\n> Signed-off-by: James <jdm12989@gmail.com>\n> ---\n>     Update git-submodule.txt\n>     \n>     Remove info about custom commands being allowed in the submodule update\n>     command to align with the gitmodules docs which states \"For security\n>     reasons, the !command form is not accepted here.\"\n>\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1401%2FEnochPrime%2Fsubmodule-docs-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1401/EnochPrime/submodule-docs-v1\n> Pull-Request: https://github.com/gitgitgadget/git/pull/1401\n>\n>  Documentation/git-submodule.txt | 6 ------\n>  1 file changed, 6 deletions(-)\n>\n> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> index 4d3ab6b9f92..b40ac72f753 100644\n> --- a/Documentation/git-submodule.txt\n> +++ b/Documentation/git-submodule.txt\n> @@ -163,12 +163,6 @@ checked out in the submodule.\n>  The following 'update' procedures are only available via the\n>  `submodule.<name>.update` configuration variable:\n>  \n> -\tcustom command;; arbitrary shell command that takes a single\n> -\t    argument (the sha1 of the commit recorded in the\n> -\t    superproject) is executed. When `submodule.<name>.update`\n> -\t    is set to '!command', the remainder after the exclamation mark\n> -\t    is the custom command.\n> -\n>  \tnone;; the submodule is not updated.\n>  \n>  If the submodule is not yet initialized, and you just want to use the\n\nHrm?\n\t\n\tdiff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\n\tindex a7683d35299..80e897d5f29 100644\n\t--- a/builtin/submodule--helper.c\n\t+++ b/builtin/submodule--helper.c\n\t@@ -2247,6 +2247,7 @@ static int run_update_command(const struct update_data *ud, int subforce)\n\t \tcase SM_UPDATE_COMMAND:\n\t \t\tcp.use_shell = 1;\n\t \t\tstrvec_push(&cp.args, ud->update_strategy.command);\n\t+\t\tBUG(\"unused??\");\n\t \t\tbreak;\n\t \tdefault:\n\t \t\tBUG(\"unexpected update strategy type: %d\",\n\t\nWill show you that this is used, i.e. this failure in\nt7406-submodule-update.sh:\n\t\n\t[...]\n\t+ cd super\n\t+ git config submodule.submodule.update !git checkout\n\t+ cd super/submodule\n\t+ git reset --hard HEAD^\n\tHEAD is now at 0c90624 upstream\n\t+ cd super\n\t+ cd submodule\n\t+ compare_head\n\t+ git rev-list --max-count=1 main\n\t+ sha_main=0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n\t+ git rev-list --max-count=1 HEAD\n\t+ sha_head=0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n\t+ test 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f = 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n\t+ git submodule update submodule\n\tBUG: builtin/submodule--helper.c:2250: unused??\n\tAborted\n\nI think what you may be confused by is that this isn't allowed in the\nin-tree .gitmodules file, and indeed you can see another BUG() in\ndetermine_submodule_update_strategy() for a panic if we'd ever get as\nfar as reading \"command\" from there.\n\nBut that's not what this part of the docs dicsusses, as the paragraph\nshown above the removed lines in the context notes.\n"},{"id":"466498","messageId":"CALwerKjpvH6V6httS9J5ws8=-n-ra7Lma4X4LHSSBLhVejp6bA@mail.gmail.com","threadId":"58740","inReplyTo":"221103.86eduk1bcw.gmgdl@evledraar.gmail.com","subject":"Re: [PATCH] documentation: update git-submodule documentation","fromName":"James McCandlish","fromEmail":"jdm12989@gmail.com","sentAt":"2022-11-04T11:25:37Z","receivedAt":"2022-11-04T11:25:55Z","isPatch":true,"sender":{"key":"jdm12989@gmail.com","avatar":null},"body":"Sorry about the confusion. Just so I'm 100% clear: the\n`submodule.<name>.update` referencing a gitconfig and not gitmodules?\n\n\nOn Thu, Nov 3, 2022 at 8:17 AM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:\n>\n>\n> On Thu, Nov 03 2022, James via GitGitGadget wrote:\n>\n> > From: James <jdm12989@gmail.com>\n> >\n> > Removes reference to custom code execution which is called out by\n> > gitmodules as not allowed.\n> >\n> > Signed-off-by: James <jdm12989@gmail.com>\n> > ---\n> >     Update git-submodule.txt\n> >\n> >     Remove info about custom commands being allowed in the submodule update\n> >     command to align with the gitmodules docs which states \"For security\n> >     reasons, the !command form is not accepted here.\"\n> >\n> > Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1401%2FEnochPrime%2Fsubmodule-docs-v1\n> > Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1401/EnochPrime/submodule-docs-v1\n> > Pull-Request: https://github.com/gitgitgadget/git/pull/1401\n> >\n> >  Documentation/git-submodule.txt | 6 ------\n> >  1 file changed, 6 deletions(-)\n> >\n> > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> > index 4d3ab6b9f92..b40ac72f753 100644\n> > --- a/Documentation/git-submodule.txt\n> > +++ b/Documentation/git-submodule.txt\n> > @@ -163,12 +163,6 @@ checked out in the submodule.\n> >  The following 'update' procedures are only available via the\n> >  `submodule.<name>.update` configuration variable:\n> >\n> > -     custom command;; arbitrary shell command that takes a single\n> > -         argument (the sha1 of the commit recorded in the\n> > -         superproject) is executed. When `submodule.<name>.update`\n> > -         is set to '!command', the remainder after the exclamation mark\n> > -         is the custom command.\n> > -\n> >       none;; the submodule is not updated.\n> >\n> >  If the submodule is not yet initialized, and you just want to use the\n>\n> Hrm?\n>\n>         diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c\n>         index a7683d35299..80e897d5f29 100644\n>         --- a/builtin/submodule--helper.c\n>         +++ b/builtin/submodule--helper.c\n>         @@ -2247,6 +2247,7 @@ static int run_update_command(const struct update_data *ud, int subforce)\n>                 case SM_UPDATE_COMMAND:\n>                         cp.use_shell = 1;\n>                         strvec_push(&cp.args, ud->update_strategy.command);\n>         +               BUG(\"unused??\");\n>                         break;\n>                 default:\n>                         BUG(\"unexpected update strategy type: %d\",\n>\n> Will show you that this is used, i.e. this failure in\n> t7406-submodule-update.sh:\n>\n>         [...]\n>         + cd super\n>         + git config submodule.submodule.update !git checkout\n>         + cd super/submodule\n>         + git reset --hard HEAD^\n>         HEAD is now at 0c90624 upstream\n>         + cd super\n>         + cd submodule\n>         + compare_head\n>         + git rev-list --max-count=1 main\n>         + sha_main=0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n>         + git rev-list --max-count=1 HEAD\n>         + sha_head=0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n>         + test 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f = 0c90624ab7f1aaa301d3bb79f60dcfed1ec4897f\n>         + git submodule update submodule\n>         BUG: builtin/submodule--helper.c:2250: unused??\n>         Aborted\n>\n> I think what you may be confused by is that this isn't allowed in the\n> in-tree .gitmodules file, and indeed you can see another BUG() in\n> determine_submodule_update_strategy() for a panic if we'd ever get as\n> far as reading \"command\" from there.\n>\n> But that's not what this part of the docs dicsusses, as the paragraph\n> shown above the removed lines in the context notes.\n\n\n\n-- \nJames McCandlish\n"}]}