# [PATCH RFC] Add a config verbose option fetch and push

2 messages from 2010-05-21 to 2010-05-21. Participants: Nathan W. Panike, Peter Kjellerstedt.
Thread: https://gitlist.dev/t/23867

## Nathan W. Panike, 2010-05-21 13:26

Subject: [PATCH RFC] Add a config verbose option fetch and push
Message-ID: <4bf69283.47c1f10a.1ecf.1183@mx.google.com>
URL: https://gitlist.dev/e/4bf69283.47c1f10a.1ecf.1183%40mx.google.com

```
---
There are a couple projects that I follow where I find it useful to always
set the verbose flag.  Setting this in the configuration file would let me 
avoid the times I forget to set it on the command line. I decided to do both
push and fetch at the same time.

 Documentation/config.txt |   10 ++++++++++
 builtin/fetch.c          |    7 +++++++
 builtin/push.c           |    7 +++++++
 3 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 39140ba..8e8a760 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -860,6 +860,11 @@ fetch.unpackLimit::
 	especially on slow filesystems.  If not set, the value of
 	`transfer.unpackLimit` is used instead.
 
+fetch.verbose::
+	If true, it is the same as setting "-v" on the command line. If it is
+	false or not defined, git will use the command line parameters to
+	decide the verboseness of fetch.
+
 format.attach::
 	Enable multipart/mixed attachments as the default for
 	'format-patch'.  The value can also be a double quoted string
@@ -1495,6 +1500,11 @@ push.default::
 * `tracking` push the current branch to its upstream branch.
 * `current` push the current branch to a branch of the same name.
 
+push.verbose::
+	If true, it is the same as using the '-v' flag on the command
+	line. If it is false, git will use the command line to determine
+	the verboseness of a push.
+
 rebase.stat::
 	Whether to show a diffstat of what changed upstream since the last
 	rebase. False by default.
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 8470850..b2891b1 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -885,6 +885,12 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)
 	return exit_code;
 }
 
+static int git_fetch_verbose_config(const char *var,const char *value, void *dummy)
+{
+	if(!strcmp("fetch.verbose",var) && !verbosity)
+		verbosity = git_config_maybe_bool(NULL,value);
+}
+
 int cmd_fetch(int argc, const char **argv, const char *prefix)
 {
 	int i;
@@ -899,6 +905,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
 
 	argc = parse_options(argc, argv, prefix,
 			     builtin_fetch_options, builtin_fetch_usage, 0);
+	git_config(git_fetch_verbose_config,NULL);
 
 	if (all) {
 		if (argc == 1)
diff --git a/builtin/push.c b/builtin/push.c
index f4358b9..6779031 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -202,6 +202,12 @@ static int do_push(const char *repo, int flags)
 	return !!errs;
 }
 
+static int git_push_verbose_config(const char *var, const char *value, void *d)
+{
+	if(!strcmp("push.verbose",var) && !verbosity)
+		verbosity = git_config_maybe_bool(NULL,value);
+}
+
 int cmd_push(int argc, const char **argv, const char *prefix)
 {
 	int flags = 0;
@@ -230,6 +236,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
 
 	git_config(git_default_config, NULL);
 	argc = parse_options(argc, argv, prefix, options, push_usage, 0);
+	git_config(git_push_verbose_config,NULL);
 
 	if (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))
 		die("--delete is incompatible with --all, --mirror and --tags");
-- 
1.7.1

```

## Peter Kjellerstedt, 2010-05-21 14:53

Subject: RE: [PATCH RFC] Add a config verbose option fetch and push
Message-ID: <A612847CFE53224C91B23E3A5B48BAC74483234EE2@xmail3.se.axis.com>
URL: https://gitlist.dev/e/A612847CFE53224C91B23E3A5B48BAC74483234EE2%40xmail3.se.axis.com
In-Reply-To: <4bf69283.47c1f10a.1ecf.1183@mx.google.com>

```
> -----Original Message-----
> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On
> Behalf Of Nathan W. Panike
> Sent: den 21 maj 2010 15:26
> To: git@vger.kernel.org
> Subject: [PATCH RFC] Add a config verbose option fetch and push
> 
> ---
> There are a couple projects that I follow where I find it useful to always
> set the verbose flag.  Setting this in the configuration file would let me
> avoid the times I forget to set it on the command line. I decided to do both
> push and fetch at the same time.
> 
>  Documentation/config.txt |   10 ++++++++++
>  builtin/fetch.c          |    7 +++++++
>  builtin/push.c           |    7 +++++++
>  3 files changed, 24 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 39140ba..8e8a760 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -860,6 +860,11 @@ fetch.unpackLimit::
>  	especially on slow filesystems.  If not set, the value of
>  	`transfer.unpackLimit` is used instead.
> 
> +fetch.verbose::
> +	If true, it is the same as setting "-v" on the command line. If it is
> +	false or not defined, git will use the command line parameters to
> +	decide the verboseness of fetch.
> +

Don't you usually use the configured option as the default, and 
then let the command line options override it (e.g., by specifying
--no-verbose).

//Peter

```
