* [PATCH] Support "git remote --quiet update"
@ 2010-04-15 22:11 Zefram
2010-04-16 2:59 ` Tay Ray Chuan
0 siblings, 1 reply; 3+ messages in thread
From: Zefram @ 2010-04-15 22:11 UTC (permalink / raw)
To: git
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Support "git remote --quiet update"
2010-04-16 2:59 ` Tay Ray Chuan
@ 2010-04-15 22:11 ` Zefram
0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 2010-04-15 22:11 UTC (permalink / raw)
To: gitster, git
Add --quiet option for git-remote, which it will pass on to git-fetch.
Signed-off-by: Zefram <zefram@fysh.org>
---
Tay Ray Chuan <rctay89@gmail.com> wrote:
>Signed-off-by?
>
> http://github.com/git/git/blob/master/Documentation/SubmittingPatches
Bah, sorry, I hadn't noticed that document. That's what I get for
jumping in quickly.
Since I'm writing an epigram now, I might as well throw in some context.
I'm a new git user, only been using it seriously for the past few days,
so I've been inhaling a lot of documentation. I found just a handful of
small annoyances. Upon checking out git.git, it turned out that most
of them had already been fixed, such as "git fetch --quiet" not really
being quiet. (I was using git 1.5.6.5, via Debian lenny.) The only
one that was left was "git remote update" not having a --quiet option.
Hence the patch.
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.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Support "git remote --quiet update"
2010-04-15 22:11 [PATCH] Support "git remote --quiet update" Zefram
@ 2010-04-16 2:59 ` Tay Ray Chuan
2010-04-15 22:11 ` Zefram
0 siblings, 1 reply; 3+ messages in thread
From: Tay Ray Chuan @ 2010-04-16 2:59 UTC (permalink / raw)
To: Zefram; +Cc: git
Hi,
On Fri, Apr 16, 2010 at 6:11 AM, Zefram <zefram@fysh.org> wrote:
> Add --quiet option for git-remote, which it will pass on to git-fetch.
Signed-off-by?
http://github.com/git/git/blob/master/Documentation/SubmittingPatches
--
Cheers,
Ray Chuan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-04-16 6:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-15 22:11 [PATCH] Support "git remote --quiet update" Zefram
2010-04-16 2:59 ` Tay Ray Chuan
2010-04-15 22:11 ` Zefram
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).