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
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 8, 2013, 15:25 UTC
Message-ID
<CALkWK0kvKzFoZmz313hR-3Z71y-MDPT37BfUi7Qrgy7hz_sErQ@mail.gmail.com>
In-Reply-To
<1370683737-28823-1-git-send-email-Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
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.
Show 13 quoted lines
> @@ -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:

/*
 * 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?

Previous: Jorge Juan Garcia GarciaNext: Junio C Hamano
Message 3 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.