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

Re: [PATCH 1/2] status: introduce status.short to enable --short by default

From
Ggarciagj <garciagj@ensibm.imag.fr>
Date
Jun 10, 2013, 08:01 UTC
Message-ID
<3774bdd37ba5b330143d5a2b675955dc@ensibm.imag.fr>
In-Reply-To
<CALkWK0kvKzFoZmz313hR-3Z71y-MDPT37BfUi7Qrgy7hz_sErQ@mail.gmail.com>
El 2013-06-08 17:25, Ramkumar Ramachandra escribió:
Show 26 quoted lines
> Jorge Juan Garcia Garcia wrote:
>> Some people always run 'git status -s'.
>> The configuration variable status.short allows to set it by default.
>
> Good feature.
>
>> @@ -1112,6 +1112,15 @@ static int git_status_config(const char *k, 
>> const char *v, void *cb)
>>                         s->submodule_summary = -1;
>>                 return 0;
>>         }
>> +       if (!strcmp(k, "status.short")) {
>> +               if (!v)
>> +                       return config_error_nonbool(k);
>> +               if (git_config_bool(k,v)) {
>> +                       status_format = STATUS_FORMAT_SHORT;
>> +                       wt_shortstatus_print(s);
>> +               }
>> +               return 0;
>> +       }
>
> Incorrect.  This is the wrong place to use config_error_nonbool():
> this is very much a bool, and a "[status] short" in ~/.gitconfig
> should not error out (all boolean variables behave in the same
> manner).  When in doubt, consult config_error_nonbool(); there's
> clearly a comment stating:
Ok. We will change it.
Show 8 quoted lines
>
> /*
>  * Call this to report error for your variable that should not
>  * get a boolean value (i.e. "[my] var" means "true").
>  */
>
> Also, why are you calling wt_shortstatus_print() here, instead of
> returning control to cmd_status(), which is going to do it anyway?
Yes, it's obviously a mistake.
Previous: garciagj
Message 7 of 7 in “status: introduce status.short to enable --short by default”
  1. 1/2 status: introduce status.short to enable --short by defaultJorge Juan Garcia Garcia, Jun 8, 2013
  2. 2/2 status: introduce status.branch to enable --branch by defaultJorge Juan Garcia Garcia, Jun 8, 2013
  3. Ramkumar RamachandraJun 8, 2013
  4. Junio C HamanoJun 9, 2013
  5. Matthieu MoyJun 9, 2013
  6. garciagjJun 10, 2013
  7. garciagjJun 10, 2013

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.