From: Junio C Hamano <gitster@pobox.com>
To: Quentin Neill <quentin.neill@gmail.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>, Git List <git@vger.kernel.org>
Subject: Re: [PATCH] blame: add blame.showemail config option
Date: Mon, 27 Apr 2015 11:10:25 -0700 [thread overview]
Message-ID: <xmqqwq0xwige.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CACfD1vvaAGkx2P3yMfZPOZrRvG3-H96zQVOCevnd-O0rBJ7wjw@mail.gmail.com> (Quentin Neill's message of "Mon, 27 Apr 2015 08:46:14 -0500")
Quentin Neill <quentin.neill@gmail.com> writes:
>> It's not clear why you relocated documentation of --show-email from
>> git-blame.txt to blame-options.txt, and the commit message does not
>> explain the move. If there's a good reason for the relocation, the
>> justification should be spelled out so that people reviewing the patch
>> or looking through history later on will not have to guess about it.
>
> I moved it to be with the other variables that had configuration
> options, but I will move it back.
Please do not do anything before you understand why there are two
places, and if you don't understand, ask.
If you do this:
$ git grep blame-options Documentation/
you would discover that blame-options.txt is meant to hold things
that are shared across "git annotate" and "git blame". What is
understood only by "git blame" but not by "git annotate" is to be
described in git-blame.txt, I think. So the criteria is not "does
it have configuration?"; it is "does git-annotate understand it?"
>>> @@ -1926,7 +1927,7 @@ static void emit_other(struct scoreboard *sb, struct blame_entry *ent, int opt)
>>> printf("%.*s", length, hex);
>>> if (opt & OUTPUT_ANNOTATE_COMPAT) {
>>> const char *name;
>>> - if (opt & OUTPUT_SHOW_EMAIL)
>>> + if ((opt & OUTPUT_SHOW_EMAIL) || show_email)
>>
>> The desired behavior is for a configuration setting to provide a
>> fallback, and for a command-line option to override the fallback. So,
>> for instance, if blame.showemail is "true", then --no-show-email
>> should countermand that. Unfortunately, the way this patch is
>> implemented, it's impossible to override the setting from the
>> command-line since show_email==true will always win (when
>> blame.showemail is "true").
>>
>> More below.
>
> I followed the code for blame.showRoot and blame.blankboundary.
I do not think that is quite true.
The code strucure for other existing options is perfectly fine.
What they do is:
- show_root is initialized to the fallback default value of
false by being in BSS;
- configuration is read to tweak that default;
- command line parser may override the default with --show-root
or --no-show-root.
And then show_root is used throughout the system.
If you truly followed this code pattern, I would expect that there
will not be a separate show_email variable introduced to support
this new configuration variable. The OUTPUT_SHOW_EMAIL bit in the
opt flag word corresponds to show_root and blank_boundary variables,
so the code to read configuration variable would set that bit in the
opt flag word before the command line parser would kick in. And the
code that checks "opt & OUTPUT_SHOW_EMAIL" currently does not have
to change at all.
next prev parent reply other threads:[~2015-04-27 18:10 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 [this message]
2015-04-27 19:23 ` Eric Sunshine
2015-04-28 7:08 ` Junio C Hamano
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=xmqqwq0xwige.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=quentin.neill@gmail.com \
--cc=sunshine@sunshineco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.