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

Re: [PATCH] blame: add blame.showemail config option

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 28, 2015, 07:08 UTC
Message-ID
<xmqqmw1svigd.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPig+cRTfB9aiinhSJp=jY7-__6dRvfAqhWZYVN3+Ut=Y79LcQ@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 15 quoted lines
> Right. Rather than having a separate global 'show_email' variable and
> consulting that variable in parallel with OUTPUT_SHOW_EMAIL throughout
> the code, instead set the OUTPUT_SHOW_EMAIL bit in git_blame_config().
> To do this, take advantage of the "callback data" argument of
> git_config(), which will arrive in git_blame_config() as its 'void
> *cb' argument. So, for instance, something like this:
>
>     static int git_blame_config(var, value, void *cb)
>     {
>         ...
>         if (!strcmp(var, "blame.showemail")) {
>             if (git_config_bool(var, value)) {
>                 int *output_options = cb;
>                *output_options |= OUTPUT_SHOW_EMAIL;
>             }
Don't forget to clear the bit when the bool is set to false, too.
Show 13 quoted lines
>             return 0;
>         }
>         ...
>     }
>
>     int cmd_blame(...)
>     {
>         ...
>         git_config(git_blame_config, &output_options);
>         ...
>         parse_options(...);
>         ...
>     }
Previous: Eric SunshineNext: Quentin Neill
Message 6 of 17 in “blame: add blame.showemail config option”
  1. blame: add blame.showemail config optionQuentin Neill, Apr 24, 2015
  2. Eric SunshineApr 24, 2015
  3. Quentin NeillApr 27, 2015
  4. Junio C HamanoApr 27, 2015
  5. Eric SunshineApr 27, 2015
  6. Junio C HamanoApr 28, 2015
  7. Quentin NeillApr 30, 2015
  8. Junio C HamanoApr 30, 2015
  9. Eric SunshineApr 30, 2015
  10. Junio C HamanoApr 30, 2015
  11. Eric SunshineApr 27, 2015
  12. Junio C HamanoMay 29, 2015
  13. Quentin NeillMay 30, 2015
  14. blame: add blame.showEmail configurationQuentin Neill, May 30, 2015
  15. Junio C HamanoMay 31, 2015
  16. Quentin NeillMay 31, 2015
  17. blame: add blame.showEmail configurationQuentin Neill, May 31, 2015

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.