git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Introduce commit.verbose config option
@ 2011-11-05 18:07 Fernando Vezzosi
  2011-11-06  2:51 ` Nguyen Thai Ngoc Duy
  2011-11-06 12:52 ` SZEDER Gábor
  0 siblings, 2 replies; 3+ messages in thread
From: Fernando Vezzosi @ 2011-11-05 18:07 UTC (permalink / raw)
  To: git

Enabling commit.verbose will make git commit behave as if --verbose was
passed on the command line.

Reviewed-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Fernando Vezzosi <buccia@repnz.net>
---
 Documentation/config.txt |    3 +++
 builtin/commit.c         |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/Documentation/config.txt b/Documentation/config.txt
index 5a841da..6826788 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -832,6 +832,9 @@ commit.template::
 	"{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the
 	specified user's home directory.
 
+commit.verbose::
+	A boolean to enable verbose mode like the --verbose flag does.
+
 include::diff-config.txt[]
 
 difftool.<tool>.path::
diff --git a/builtin/commit.c b/builtin/commit.c
index c46f2d1..c2a1f3d 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -1331,6 +1331,10 @@ static int git_commit_config(const char *k, const char *v, void *cb)
 		include_status = git_config_bool(k, v);
 		return 0;
 	}
+	if (!strcmp(k, "commit.verbose")) {
+		verbose = git_config_bool(k, v);
+		return 0;
+	}
 
 	return git_status_config(k, v, s);
 }
-- 
1.7.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Introduce commit.verbose config option
  2011-11-05 18:07 [PATCH] Introduce commit.verbose config option Fernando Vezzosi
@ 2011-11-06  2:51 ` Nguyen Thai Ngoc Duy
  2011-11-06 12:52 ` SZEDER Gábor
  1 sibling, 0 replies; 3+ messages in thread
From: Nguyen Thai Ngoc Duy @ 2011-11-06  2:51 UTC (permalink / raw)
  To: Fernando Vezzosi; +Cc: git

On Sun, Nov 6, 2011 at 1:07 AM, Fernando Vezzosi <buccia@repnz.net> wrote:
> Enabling commit.verbose will make git commit behave as if --verbose was
> passed on the command line.

Is it necessary? If you want short command, you would use alias
instead of typing "commit". Adding --verbose to the alias to make the
command even shorter is straightforward.
-- 
Duy

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Introduce commit.verbose config option
  2011-11-05 18:07 [PATCH] Introduce commit.verbose config option Fernando Vezzosi
  2011-11-06  2:51 ` Nguyen Thai Ngoc Duy
@ 2011-11-06 12:52 ` SZEDER Gábor
  1 sibling, 0 replies; 3+ messages in thread
From: SZEDER Gábor @ 2011-11-06 12:52 UTC (permalink / raw)
  To: Fernando Vezzosi; +Cc: git

On Sat, Nov 05, 2011 at 07:07:35PM +0100, Fernando Vezzosi wrote:
> Enabling commit.verbose will make git commit behave as if --verbose was
> passed on the command line.
> 
> Reviewed-by: Sverre Rabbelier <srabbelier@gmail.com>
> Signed-off-by: Fernando Vezzosi <buccia@repnz.net>
> ---
>  Documentation/config.txt |    3 +++
>  builtin/commit.c         |    4 ++++
>  2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/Documentation/config.txt b/Documentation/config.txt
> index 5a841da..6826788 100644
> --- a/Documentation/config.txt
> +++ b/Documentation/config.txt
> @@ -832,6 +832,9 @@ commit.template::
>  	"{tilde}/" is expanded to the value of `$HOME` and "{tilde}user/" to the
>  	specified user's home directory.
>  
> +commit.verbose::
> +	A boolean to enable verbose mode like the --verbose flag does.
> +

I just tried out this patch, and found that setting commit.verbose to
true also affects git commit's behavior when invoked from scripts
where you can't pass --verbose to git commit.  I.e. the diff to be
committed is shown for git revert, interactive rebase's reword or
squash commands, or during 'git rebase --continue' after resolving a
conflict.  I think this should be mentioned both in the commit message
and in the documentation.

Anyway, I like this change because I have a somewhat convoluted and
flaky combination of hooks and editor scripts to do the same, and now
I can finally get rid of them.


Best,
Gábor

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-06 12:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-05 18:07 [PATCH] Introduce commit.verbose config option Fernando Vezzosi
2011-11-06  2:51 ` Nguyen Thai Ngoc Duy
2011-11-06 12:52 ` SZEDER Gábor

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).