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

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

From
Pranit Bauva <pranit.bauva@gmail.com>
Date
Mar 15, 2016, 21:09 UTC
Message-ID
<CAFZEwPOK1hH8CuFc6TohDc5xq7GXpp0DBnQi4QQ6m+8dspUbeQ@mail.gmail.com>
In-Reply-To
<xmqqlh5j7am8.fsf@gitster.mtv.corp.google.com>
On Wed, Mar 16, 2016 at 1:54 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Pranit Bauva <pranit.bauva@gmail.com> writes:
>
>> First one to introduce a new variable `config_verbose` to store the
>> value read by the config. Till then the value of verbose can be set
>> through command line options. Depending on the situation as you
>> described, it can then make the modification. Another approach would
>> be to swap the places where the configuration file is read and where
>> arguments are parsed. I personally think the first approach as more
>> appropriate as in the latter one, there might be some parts of code
>> which can break.
>
> Changing config-first-and-then-command-line is likely to break
> things, unless you do a lot more work to avoid breakage ;-)
I had guessed this correctly! :)
Show 19 quoted lines
> Wouldn't it be the simplest to do:
>
>  * initialize opt-verbose to "unspecified";
>  * initialize config-verbosity to "unspecified";
>  * let git_config() update config-verbosity;
>  * let parse_options() update opt-verbose.
>
> and then
>
>  * if opt-verbose is still "unspecified", then overwrite it with
>    config-verbosity.
>
>  * if opt-verbose is still "unspecified" after that, then neither
>    the command line nor the configuration gave you verbosity.
>
>  * otherwise opt-verbose at this point has what verbosity level to
>    use.
>
> ?

I just realized that both of our approaches breaks the condition with no-verbose. If commit.verbose is set to true and --no-verbose is passed, then it should not give verbose output. But I suppose that is the reason you are saying "unspecified". If `opt-verbose` is 0 then it would mean --no-verbose is activated. If it is still "unspecified" then there would not be any such option. But now the question is how do you set a variable as "unspecified". I can set `opt-verbose` as -1. But then I am still not convinced for the requirement of another variable `opt-verbose` as I believe that the `verbose` and `config_verbose` are quite enough for this. First `config_verbose` will read from configuration file. Then `verbose` will read from command line options. If `verbose` is unspecified then it will use `config_verbose`, else if `verbose` is 0 it will ignore `config_verbose` else if `verbose` has a value greater than 0 then it will stay as it is. Or is there something else which I forgot to consider?

Previous: Junio C HamanoNext: Junio C Hamano
Message 7 of 9 in “commit: add a commit.verbose config variable”
  1. commit: add a commit.verbose config variablePranit Bauva, Mar 14, 2016
  2. SZEDER GáborMar 15, 2016
  3. Pranit BauvaMar 15, 2016
  4. Eric SunshineMar 15, 2016
  5. Pranit BauvaMar 15, 2016
  6. Junio C HamanoMar 15, 2016
  7. Pranit BauvaMar 15, 2016
  8. Junio C HamanoMar 15, 2016
  9. Pranit BauvaMar 15, 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.