git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Wise <pabs3@bonedaddy.net>
To: git@vger.kernel.org
Cc: Paul Wise <pabs3@bonedaddy.net>
Subject: [PATCH] fetch: only show "Fetching remote" when verbose mode is enabled
Date: Fri, 16 Oct 2015 14:49:32 +0800	[thread overview]
Message-ID: <1444978172-7317-1-git-send-email-pabs3@bonedaddy.net> (raw)

By default when fetching one remote nothing is printed unless there
are changes that need fetching. This makes fetching multiple remotes
be just as verbose as fetching a single remote.

This is needed when fetching multiple repositories using the myrepos
tool in minimal output mode, where myrepos only prints the repository
names when git fetch prints some output. For example in the output below
the cgit and git-remote-* lines would be hidden if git fetch were
silent by default when fetching multiple remotes, since the default
for myrepos is to fetch all remotes for git repositories.

pabs@chianamo ~ $ mr -m fetch
mr fetch: /home/pabs/cgit
Fetching origin

mr fetch: /home/pabs/git
Fetching origin
From https://github.com/git/git
 - [tag update]      junio-gpg-pub -> junio-gpg-pub
Fetching hg
From https://github.com/SRabbelier/git
 - [tag update]      junio-gpg-pub -> junio-gpg-pub

mr fetch: /home/pabs/git-remote-bzr
Fetching origin

mr fetch: /home/pabs/git-remote-hg
Fetching origin

Signed-off-by: Paul Wise <pabs3@bonedaddy.net>
---
 builtin/fetch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/builtin/fetch.c b/builtin/fetch.c
index 9a3869f..fc33667 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1067,7 +1067,7 @@ static int fetch_multiple(struct string_list *list)
 	for (i = 0; i < list->nr; i++) {
 		const char *name = list->items[i].string;
 		argv_array_push(&argv, name);
-		if (verbosity >= 0)
+		if (verbosity >= 1)
 			printf(_("Fetching %s\n"), name);
 		if (run_command_v_opt(argv.argv, RUN_GIT_CMD)) {
 			error(_("Could not fetch %s"), name);
-- 
2.6.1

             reply	other threads:[~2015-10-16  7:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16  6:49 Paul Wise [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-10-25  2:49 [PATCH] fetch: only show "Fetching remote" when verbose mode is enabled Paul Wise
2015-10-25 18:34 ` Junio C Hamano
2015-10-26  0:04   ` Paul Wise
2015-10-26  2:21     ` 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=1444978172-7317-1-git-send-email-pabs3@bonedaddy.net \
    --to=pabs3@bonedaddy.net \
    --cc=git@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).