{"thread":{"id":"23867","subject":"[PATCH RFC] Add a config verbose option fetch and push","startedAt":"2010-05-21T13:26:11Z","lastAt":"2010-05-21T14:53:13Z","messageCount":2,"participants":["Nathan W. Panike","Peter Kjellerstedt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"142030","messageId":"4bf69283.47c1f10a.1ecf.1183@mx.google.com","threadId":"23867","inReplyTo":null,"subject":"[PATCH RFC] Add a config verbose option fetch and push","fromName":"Nathan W. Panike","fromEmail":"nathan.panike@gmail.com","sentAt":"2010-05-21T13:26:11Z","receivedAt":"2010-05-21T13:26:11Z","isPatch":true,"sender":{"key":"nathan.panike@gmail.com","avatar":"https://avatars.githubusercontent.com/u/389447?v=4"},"body":"---\nThere are a couple projects that I follow where I find it useful to always\nset the verbose flag.  Setting this in the configuration file would let me \navoid the times I forget to set it on the command line. I decided to do both\npush and fetch at the same time.\n\n Documentation/config.txt |   10 ++++++++++\n builtin/fetch.c          |    7 +++++++\n builtin/push.c           |    7 +++++++\n 3 files changed, 24 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 39140ba..8e8a760 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -860,6 +860,11 @@ fetch.unpackLimit::\n \tespecially on slow filesystems.  If not set, the value of\n \t`transfer.unpackLimit` is used instead.\n \n+fetch.verbose::\n+\tIf true, it is the same as setting \"-v\" on the command line. If it is\n+\tfalse or not defined, git will use the command line parameters to\n+\tdecide the verboseness of fetch.\n+\n format.attach::\n \tEnable multipart/mixed attachments as the default for\n \t'format-patch'.  The value can also be a double quoted string\n@@ -1495,6 +1500,11 @@ push.default::\n * `tracking` push the current branch to its upstream branch.\n * `current` push the current branch to a branch of the same name.\n \n+push.verbose::\n+\tIf true, it is the same as using the '-v' flag on the command\n+\tline. If it is false, git will use the command line to determine\n+\tthe verboseness of a push.\n+\n rebase.stat::\n \tWhether to show a diffstat of what changed upstream since the last\n \trebase. False by default.\ndiff --git a/builtin/fetch.c b/builtin/fetch.c\nindex 8470850..b2891b1 100644\n--- a/builtin/fetch.c\n+++ b/builtin/fetch.c\n@@ -885,6 +885,12 @@ static int fetch_one(struct remote *remote, int argc, const char **argv)\n \treturn exit_code;\n }\n \n+static int git_fetch_verbose_config(const char *var,const char *value, void *dummy)\n+{\n+\tif(!strcmp(\"fetch.verbose\",var) && !verbosity)\n+\t\tverbosity = git_config_maybe_bool(NULL,value);\n+}\n+\n int cmd_fetch(int argc, const char **argv, const char *prefix)\n {\n \tint i;\n@@ -899,6 +905,7 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)\n \n \targc = parse_options(argc, argv, prefix,\n \t\t\t     builtin_fetch_options, builtin_fetch_usage, 0);\n+\tgit_config(git_fetch_verbose_config,NULL);\n \n \tif (all) {\n \t\tif (argc == 1)\ndiff --git a/builtin/push.c b/builtin/push.c\nindex f4358b9..6779031 100644\n--- a/builtin/push.c\n+++ b/builtin/push.c\n@@ -202,6 +202,12 @@ static int do_push(const char *repo, int flags)\n \treturn !!errs;\n }\n \n+static int git_push_verbose_config(const char *var, const char *value, void *d)\n+{\n+\tif(!strcmp(\"push.verbose\",var) && !verbosity)\n+\t\tverbosity = git_config_maybe_bool(NULL,value);\n+}\n+\n int cmd_push(int argc, const char **argv, const char *prefix)\n {\n \tint flags = 0;\n@@ -230,6 +236,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)\n \n \tgit_config(git_default_config, NULL);\n \targc = parse_options(argc, argv, prefix, options, push_usage, 0);\n+\tgit_config(git_push_verbose_config,NULL);\n \n \tif (deleterefs && (tags || (flags & (TRANSPORT_PUSH_ALL | TRANSPORT_PUSH_MIRROR))))\n \t\tdie(\"--delete is incompatible with --all, --mirror and --tags\");\n-- \n1.7.1\n"},{"id":"142034","messageId":"A612847CFE53224C91B23E3A5B48BAC74483234EE2@xmail3.se.axis.com","threadId":"23867","inReplyTo":"4bf69283.47c1f10a.1ecf.1183@mx.google.com","subject":"RE: [PATCH RFC] Add a config verbose option fetch and push","fromName":"Peter Kjellerstedt","fromEmail":"peter.kjellerstedt@axis.com","sentAt":"2010-05-21T14:53:13Z","receivedAt":"2010-05-21T14:53:13Z","isPatch":true,"sender":{"key":"peter.kjellerstedt@axis.com","avatar":"https://gravatar.com/avatar/6d5a0182283c8eccd7b134a54dbfd5f30038f3ad4d38b96f424884b614a61ca2?d=mp&s=160"},"body":"> -----Original Message-----\n> From: git-owner@vger.kernel.org [mailto:git-owner@vger.kernel.org] On\n> Behalf Of Nathan W. Panike\n> Sent: den 21 maj 2010 15:26\n> To: git@vger.kernel.org\n> Subject: [PATCH RFC] Add a config verbose option fetch and push\n> \n> ---\n> There are a couple projects that I follow where I find it useful to always\n> set the verbose flag.  Setting this in the configuration file would let me\n> avoid the times I forget to set it on the command line. I decided to do both\n> push and fetch at the same time.\n> \n>  Documentation/config.txt |   10 ++++++++++\n>  builtin/fetch.c          |    7 +++++++\n>  builtin/push.c           |    7 +++++++\n>  3 files changed, 24 insertions(+), 0 deletions(-)\n> \n> diff --git a/Documentation/config.txt b/Documentation/config.txt\n> index 39140ba..8e8a760 100644\n> --- a/Documentation/config.txt\n> +++ b/Documentation/config.txt\n> @@ -860,6 +860,11 @@ fetch.unpackLimit::\n>  \tespecially on slow filesystems.  If not set, the value of\n>  \t`transfer.unpackLimit` is used instead.\n> \n> +fetch.verbose::\n> +\tIf true, it is the same as setting \"-v\" on the command line. If it is\n> +\tfalse or not defined, git will use the command line parameters to\n> +\tdecide the verboseness of fetch.\n> +\n\nDon't you usually use the configured option as the default, and \nthen let the command line options override it (e.g., by specifying\n--no-verbose).\n\n//Peter\n"}]}