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

Re: [PATCH] submodule--helper: accept '-i' shorthand for update --init

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 8, 2026, 20:12 UTC
Message-ID
<xmqq8q7ltf51.fsf@gitster.g>
In-Reply-To
<20260708-submodule-init-v1-1-719456077262@atmark-techno.com>
Dominique Martinet <dominique.martinet@atmark-techno.com> writes:
Show 14 quoted lines
> commit 3ad0ba722744 ("git-submodule.sh: improve variables readability")
> made `git submodules update -i` pass `-i` as is to submodule--helper,
> but it fails with `error: unknown switch `i'` because the helper does
> not accept the short option.
>
> All other short options supported by git-submodule.sh are properly
> handle in the helper, so also add the alias for --init
>
> Fixes: 3ad0ba722744 ("git-submodule.sh: improve variables readability")
> Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> ---
> This apparently can't be used much because it's been broken since v2.49,
> and it's not in the help, but I guess we might as well fix this since it
> used to work?

3ad0ba7227 (git-submodule.sh: improve variables readability, 2024-12-11) is v2.49.0-rc0~107^2~1 and indeed we broke it and nobody has noticed and reported since then. An obvious alternative would be to give a single-liner:

diff --git c/git-submodule.sh w/git-submodule.sh
index 2999b31fad..9a989edb20 100755
--- c/git-submodule.sh
+++ w/git-submodule.sh
@@ -285,7 +285,7 @@ cmd_update()
 			progress=$1
 			;;
 		-i|--init)
-			init=$1
+			init=--init
 			;;
 		--require-init)
 			require_init=$1


but since anybody should be directly running "git submodule--helper"
by hand, I think it is perfectly fine to teach it a short-option
like your patch does.

Will apply.  Thanks.
Previous: Dominique Martinet
Message 2 of 2 in “submodule--helper: accept '-i' shorthand for update --init”
  1. submodule--helper: accept '-i' shorthand for update --initDominique Martinet, Jul 8, 2026
  2. Junio C HamanoJul 8, 2026

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.