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

[PATCH v2] Don't pass -v to submodule command

From
Sven Strickroth <email@cs-ware.de>
Date
Dec 1, 2022, 08:34 UTC
Message-ID
<49a10767-8cdf-4c40-eb74-c7c61b80b7e7@cs-ware.de>
In-Reply-To
<80d5eb7c-c668-d325-2aaa-cbee742d1f15@cs-ware.de>

"git pull -v --recurse-submodules" propagates the "-v" to the submdoule command which does not support "-v" yet.

Commit a56771a668d introduced this regression.
Signed-off-by: Sven Strickroth <email@cs-ware.de>
---
  builtin/pull.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/builtin/pull.c b/builtin/pull.c
index 1ab4de0005..c7f65b39ec 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -256,11 +256,11 @@ static struct option pull_options[] = {
  /**
   * Pushes "-q" or "-v" switches into arr to match the opt_verbosity level.
   */
-static void argv_push_verbosity(struct strvec *arr)
+static void argv_push_verbosity(struct strvec *arr, int include_v)
  {
  	int verbosity;

-	for (verbosity = opt_verbosity; verbosity > 0; verbosity--)
+	for (verbosity = opt_verbosity; include_v && verbosity > 0; verbosity--)
  		strvec_push(arr, "-v");

  	for (verbosity = opt_verbosity; verbosity < 0; verbosity++)
@@ -520,7 +520,7 @@ static int run_fetch(const char *repo, const char **refspecs)
  	strvec_pushl(&cmd.args, "fetch", "--update-head-ok", NULL);

  	/* Shared options */
-	argv_push_verbosity(&cmd.args);
+	argv_push_verbosity(&cmd.args, 1);
  	if (opt_progress)
  		strvec_push(&cmd.args, opt_progress);

@@ -629,7 +629,7 @@ static int rebase_submodules(void)
  	cp.no_stdin = 1;
  	strvec_pushl(&cp.args, "submodule", "update",
  		     "--recursive", "--rebase", NULL);
-	argv_push_verbosity(&cp.args);
+	argv_push_verbosity(&cp.args, 0);

  	return run_command(&cp);
  }
@@ -642,7 +642,7 @@ static int update_submodules(void)
  	cp.no_stdin = 1;
  	strvec_pushl(&cp.args, "submodule", "update",
  		     "--recursive", "--checkout", NULL);
-	argv_push_verbosity(&cp.args);
+	argv_push_verbosity(&cp.args, 0);

  	return run_command(&cp);
  }
@@ -657,7 +657,7 @@ static int run_merge(void)
  	strvec_pushl(&cmd.args, "merge", NULL);

  	/* Shared options */
-	argv_push_verbosity(&cmd.args);
+	argv_push_verbosity(&cmd.args, 1);
  	if (opt_progress)
  		strvec_push(&cmd.args, opt_progress);

@@ -881,7 +881,7 @@ static int run_rebase(const struct object_id *newbase,
  	strvec_push(&cmd.args, "rebase");

  	/* Shared options */
-	argv_push_verbosity(&cmd.args);
+	argv_push_verbosity(&cmd.args, 1);

  	/* Options passed to git-rebase */
  	if (opt_rebase == REBASE_MERGES)
-- 
2.38.1.windows.1
Previous: Sven StrickrothNext: Junio C Hamano
Message 6 of 9 in “git pull --verbose with submodules ends in error message”
  1. Fink, MikeNov 24, 2022
  2. Sven StrickrothNov 25, 2022
  3. Don't pass -v to submodule commandSven Strickroth, Nov 30, 2022
  4. Ævar Arnfjörð BjarmasonNov 30, 2022
  5. Sven StrickrothDec 1, 2022
  6. Don't pass -v to submodule commandSven Strickroth, Dec 1, 2022
  7. Junio C HamanoDec 2, 2022
  8. submodule: Accept -v for update commandSven Strickroth, Dec 10, 2022
  9. Junio C HamanoDec 18, 2022

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.