All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] submodule--helper: accept '-i' shorthand for update --init
@ 2026-07-08  3:33 Dominique Martinet
  2026-07-08 20:12 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Dominique Martinet @ 2026-07-08  3:33 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason, Junio C Hamano, Glen Choo,
	Atharva Raykar
  Cc: Roy Eldar, git, Dominique Martinet

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?

Thanks!
---
 builtin/submodule--helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 1cc82a134db2..3ec8bf50532e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -2990,7 +2990,7 @@ static int module_update(int argc, const char **argv, const char *prefix,
 	struct option module_update_options[] = {
 		OPT__SUPER_PREFIX(&opt.super_prefix),
 		OPT__FORCE(&opt.force, N_("force checkout updates"), 0),
-		OPT_BOOL(0, "init", &opt.init,
+		OPT_BOOL('i', "init", &opt.init,
 			 N_("initialize uninitialized submodules before update")),
 		OPT_BOOL(0, "remote", &opt.remote,
 			 N_("use SHA-1 of submodule's remote tracking branch")),

---
base-commit: 11320dd2066f2139870e36987240abc981cb493c



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-08 20:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-08  3:33 [PATCH] submodule--helper: accept '-i' shorthand for update --init Dominique Martinet
2026-07-08 20:12 ` Junio C Hamano

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.