git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] add a commit.verbose config variable

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Mar 9, 2016, 21:21 UTC
Message-ID
<vpqlh5r9wjx.fsf@anie.imag.fr>
In-Reply-To
<010201535cb62b56-9aa72755-b730-478c-9244-41a1ee69e231-000000@eu-west-1.amazonses.com>
Hi,

This is v2, right? Then call it [PATCH v2] in the title, and summarize the diff wrt v1. As much as possible, Cc people who participated in the review of v1.

Pranit Bauva <pranit.bauva@gmail.com> writes:
> Since many people always run the command with this option, and would
> prefer not to use the argument again and again but instead specify it in
> the configuration file.

"Since ... and ..." calls for a verb to end the sentence (already noted by Eric with v1).

> +commit.verbose::
> +	A boolean to specify whether to always include the verbose option
> +	with `git commit`. See linkgit:git-commit[1]

Either say "See linkgit:git-commit[1]" between parenthesis, or add a period (.) at the end of the sentence.

> +--override-verbose::
> +	Disable verbose for the commit if you have activated it
> +	permanently in the configuration variable `commit.verbose`.

The convention is to call this --no-verbose. --override-verbose is not a good name for such option.

Look how other similar cases are managed (e.g. status.short, status.branch, am.threeway)

Show 7 quoted lines
> @@ -1654,6 +1656,11 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
>  	argc = parse_and_validate_options(argc, argv, builtin_commit_options,
>  					  builtin_commit_usage,
>  					  prefix, current_head, &s);
> +
> +	if( !override_verbose )
> +		if( !verbose )
Style: spaces between if and (, but not inside ( ).
> +			git_config_get_bool("commit.verbose", &verbose);

This is a strange way to write the "cli takes precedence over config". The usual way is to read from least precedence to highest precedence, i.e. git_config_get_bool before calling parse_option.

You dropped the "RFC" tag from the subject line, but your patch still lacks a test. It cannot be called final without.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Pranit Bauva
Message 3 of 3 in “add a commit.verbose config variable”
  1. add a commit.verbose config variablePranit Bauva, Mar 9, 2016
  2. Pranit BauvaMar 9, 2016
  3. Matthieu MoyMar 9, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.