git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] submodule foreach: fix recursion of options

From
Duy Nguyen <pclouds@gmail.com>
Date
Jun 25, 2019, 11:18 UTC
Message-ID
<CACsJy8BnpkfYwKJiz2u5=yhoyLQzu5yAcsvmL75bxWop=ZRh0A@mail.gmail.com>
In-Reply-To
<20190624202653.13810-2-MorianSonnet@googlemail.com>
On Tue, Jun 25, 2019 at 5:02 AM Morian Sonnet <moriansonnet@gmail.com> wrote:
Show 30 quoted lines
>
> Calling
>
>     git submodule foreach --recursive <subcommand> --<option>
>
> leads to an error stating that the option --<option> is unknown to
> submodule--helper. That is of course only, when <option> is not a valid
> option for git submodule foreach.
>
> The reason for this is, that above call is internally translated into a
> call to submodule--helper:
>
>     git submodule--helper foreach --recursive \
>         -- <subcommand> --<option>
>
> This call starts by executing the subcommand with its option inside the
> first level submodule and continues by calling the next iteration of
> the submodule foreach call
>
>     git --super-prefix <submodulepath> submodule--helper \
>       foreach --recursive <subcommand> --<option>
>
> inside the first level submodule. Note that the double dash in front of
> the subcommand is missing.
>
> This problem starts to arise only recently, as the
> PARSE_OPT_KEEP_UNKNOWN flag for the argument parsing of git submodule
> foreach was removed in commit a282f5a906. Hence, the unknown option is
> complained about now, as the argument parsing is not properly ended by
> the double dash.

My bad. Last time I checked *.sh but forgot about *.c. I looked around this time in *.c. This should be the only submodule--helper invocation that needs "--".

-- 
Duy
Previous: Morian SonnetNext: Junio C Hamano
Message 18 of 19 in “submodule foreach: fix recursion of options”
  1. 0/1 submodule foreach: fix recursion of optionsMorian Sonnet via GitGitGadget, Jun 12, 2019
  2. 1/1 submodule foreach: fix recursion of optionsMorian Sonnet via GitGitGadget, Jun 12, 2019
  3. Eric SunshineJun 12, 2019
  4. 0/1 submodule foreach: fix recursion of optionsMorian Sonnet via GitGitGadget, Jun 12, 2019
  5. 1/1 submodule foreach: fix recursion of optionsMorian Sonnet via GitGitGadget, Jun 12, 2019
  6. Morian SonnetJun 18, 2019
  7. Johannes SchindelinJun 19, 2019
  8. Morian SonnetJun 22, 2019
  9. Johannes SchindelinJun 24, 2019
  10. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  11. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  12. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  13. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  14. Johannes SchindelinJun 24, 2019
  15. Junio C HamanoJun 24, 2019
  16. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  17. submodule foreach: fix recursion of optionsMorian Sonnet, Jun 24, 2019
  18. Duy NguyenJun 25, 2019
  19. Junio C HamanoJun 25, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.