From: Zefram <zefram@fysh•org>
To: git@vger•kernel.org
Subject: [PATCH] Support "git remote --quiet update"
Date: Thu, 15 Apr 2010 23:11:16 +0100 [thread overview]
Message-ID: <E1O2XT7-00011E-RT@lake.fysh.org> (raw)
Add --quiet option for git-remote, which it will pass on to git-fetch.
---
Documentation/git-remote.txt | 9 ++++++++-
builtin/remote.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/Documentation/git-remote.txt b/Documentation/git-remote.txt
index 3fc599c..25f6c05 100644
--- a/Documentation/git-remote.txt
+++ b/Documentation/git-remote.txt
@@ -19,7 +19,8 @@ SYNOPSIS
'git remote set-url --delete' [--push] <name> <url>
'git remote' [-v | --verbose] 'show' [-n] <name>
'git remote prune' [-n | --dry-run] <name>
-'git remote' [-v | --verbose] 'update' [-p | --prune] [group | remote]...
+'git remote' [-v | --verbose] [-q | --quiet] 'update'
+ [-p | --prune] [group | remote]...
DESCRIPTION
-----------
@@ -30,6 +31,12 @@ Manage the set of repositories ("remotes") whose branches you track.
OPTIONS
-------
+-q::
+--quiet::
+ Pass --quiet to git-fetch. Progress is not reported to the
+ standard error stream.
+ NOTE: This must be placed between `remote` and `subcommand`.
+
-v::
--verbose::
Be a little more verbose and show remote url after name.
diff --git a/builtin/remote.c b/builtin/remote.c
index 277765b..5447780 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -15,7 +15,7 @@ static const char * const builtin_remote_usage[] = {
"git remote set-head <name> (-a | -d | <branch>)",
"git remote [-v | --verbose] show [-n] <name>",
"git remote prune [-n | --dry-run] <name>",
- "git remote [-v | --verbose] update [-p | --prune] [group | remote]",
+ "git remote [-v | --verbose] [-q | --quiet] update [-p | --prune] [group | remote]",
"git remote set-url <name> <newurl> [<oldurl>]",
"git remote set-url --add <name> <newurl>",
"git remote set-url --delete <name> <url>",
@@ -68,7 +68,7 @@ static const char * const builtin_remote_seturl_usage[] = {
#define GET_HEAD_NAMES (1<<1)
#define GET_PUSH_REF_STATES (1<<2)
-static int verbose;
+static int verbosity;
static int show_all(void);
static int prune_remote(const char *remote, int dry_run);
@@ -94,8 +94,8 @@ static int opt_parse_track(const struct option *opt, const char *arg, int not)
static int fetch_remote(const char *name)
{
const char *argv[] = { "fetch", name, NULL, NULL };
- if (verbose) {
- argv[1] = "-v";
+ if (verbosity != 0) {
+ argv[1] = verbosity > 0 ? "-v" : "-q";
argv[2] = name;
}
printf("Updating %s\n", name);
@@ -1246,8 +1246,8 @@ static int update(int argc, const char **argv)
if (prune)
fetch_argv[fetch_argc++] = "--prune";
- if (verbose)
- fetch_argv[fetch_argc++] = "-v";
+ if (verbosity != 0)
+ fetch_argv[fetch_argc++] = verbosity > 0 ? "-v" : "-q";
fetch_argv[fetch_argc++] = "--multiple";
if (argc < 2)
fetch_argv[fetch_argc++] = "default";
@@ -1395,7 +1395,7 @@ static int show_all(void)
sort_string_list(&list);
for (i = 0; i < list.nr; i++) {
struct string_list_item *item = list.items + i;
- if (verbose)
+ if (verbosity > 0)
printf("%s\t%s\n", item->string,
item->util ? (const char *)item->util : "");
else {
@@ -1412,7 +1412,7 @@ static int show_all(void)
int cmd_remote(int argc, const char **argv, const char *prefix)
{
struct option options[] = {
- OPT_BOOLEAN('v', "verbose", &verbose, "be verbose; must be placed before a subcommand"),
+ OPT__VERBOSITY(&verbosity),
OPT_END()
};
int result;
--
1.7.1.rc1.12.ga601.dirty
next reply other threads:[~2010-04-15 22:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-15 22:11 Zefram [this message]
2010-04-16 2:59 ` [PATCH] Support "git remote --quiet update" Tay Ray Chuan
2010-04-15 22:11 ` Zefram
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=E1O2XT7-00011E-RT@lake.fysh.org \
--to=zefram@fysh$(echo .)org \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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