public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Eric Sunshine <sunshine@sunshineco•com>
Cc: Quentin Neill <quentin.neill@gmail•com>, Git List <git@vger•kernel.org>
Subject: Re: [PATCH] blame: add blame.showemail config option
Date: Tue, 28 Apr 2015 00:08:02 -0700	[thread overview]
Message-ID: <xmqqmw1svigd.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAPig+cRTfB9aiinhSJp=jY7-__6dRvfAqhWZYVN3+Ut=Y79LcQ@mail.gmail.com> (Eric Sunshine's message of "Mon, 27 Apr 2015 15:23:25 -0400")

Eric Sunshine <sunshine@sunshineco•com> writes:

> 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.

>             return 0;
>         }
>         ...
>     }
>
>     int cmd_blame(...)
>     {
>         ...
>         git_config(git_blame_config, &output_options);
>         ...
>         parse_options(...);
>         ...
>     }

  reply	other threads:[~2015-04-28  7:11 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24  2:13 [PATCH] blame: add blame.showemail config option Quentin Neill
2015-04-24  5:22 ` Eric Sunshine
2015-04-27 13:46   ` Quentin Neill
2015-04-27 18:10     ` Junio C Hamano
2015-04-27 19:23       ` Eric Sunshine
2015-04-28  7:08         ` Junio C Hamano [this message]
2015-04-30 14:03           ` Quentin Neill
2015-04-30 16:10             ` Junio C Hamano
2015-04-30 21:33             ` Eric Sunshine
2015-04-30 21:43               ` Junio C Hamano
2015-04-27 19:57     ` Eric Sunshine
2015-05-29 19:40     ` Junio C Hamano
2015-05-30 20:31       ` Quentin Neill
2015-05-30 21:38       ` [PATCH v2] blame: add blame.showEmail configuration Quentin Neill
2015-05-31 18:13         ` Junio C Hamano
2015-05-31 19:24           ` Quentin Neill
2015-05-31 19:27       ` [PATCH v3] " Quentin Neill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqmw1svigd.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=quentin.neill@gmail$(echo .)com \
    --cc=sunshine@sunshineco$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox