All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Strickroth <email@cs-ware.de>
To: git <git@vger.kernel.org>
Cc: "Junio C Hamano" <gitster@pobox.com>,
	"Robin H. Johnson" <robbat2@gentoo.org>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2] Don't pass -v to submodule command
Date: Thu, 1 Dec 2022 09:34:53 +0100	[thread overview]
Message-ID: <49a10767-8cdf-4c40-eb74-c7c61b80b7e7@cs-ware.de> (raw)
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



  reply	other threads:[~2022-12-01  8:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 12:47 git pull --verbose with submodules ends in error message Fink, Mike
2022-11-25 15:56 ` Sven Strickroth
2022-11-30 18:30   ` [PATCH] Don't pass -v to submodule command Sven Strickroth
2022-11-30 19:17     ` Ævar Arnfjörð Bjarmason
2022-12-01  8:32       ` Sven Strickroth
2022-12-01  8:34         ` Sven Strickroth [this message]
2022-12-02  0:24       ` Junio C Hamano
2022-12-10 13:06         ` [PATCH] submodule: Accept -v for update command Sven Strickroth
2022-12-18  1:25           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49a10767-8cdf-4c40-eb74-c7c61b80b7e7@cs-ware.de \
    --to=email@cs-ware.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=robbat2@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.