Subject: Re: [PATCH] format-patch: add support for mailmap file

From: Junio C Hamano <[email-masked]>
Date: Wed, 14 Aug 2024 14:53:04 -0700

Jacob Keller <[email-masked]> writes:

> diff --git a/builtin/log.c b/builtin/log.c
> index 4d4b60caa76a..94560add6fbc 100644
> --- a/builtin/log.c
> +++ b/builtin/log.c
> @@ -975,6 +975,7 @@ struct format_config {
>  	struct log_config log;
>  	enum thread_level thread;
>  	int do_signoff;
> +	int use_mailmap;

As we share the "--[no-]mailmap" option from the command line with
"git log", shouldn't we be able to reuse log.use_mailmap_config as
well without adding yet another member to the struct?  "git log"
defaults use_mailmap_config to true, but this command would want to
default it to false to avoid disrupting existing users, or
something, perhaps?

> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
> index 8708b3159309..f3de349990bf 100644
> --- a/Documentation/git-format-patch.txt
> +++ b/Documentation/git-format-patch.txt
> @@ -30,6 +30,7 @@ SYNOPSIS
>  		   [--range-diff=<previous> [--creation-factor=<percent>]]
>  		   [--filename-max-length=<n>]
>  		   [--progress]
> +		   [(--mailmap|--no-mailmap|--use-mailmap|--no-use-mailmap)]

We seem to say "[--[no-]cover-letter]" to abbreviate, and because
"--[no-]use-mailmap" is merely a synonym, shouldn't it be sufficient
to say

		   [--[no-]mailmap]

without any other frills?  I find the use of the (al|terna|tive)
here especially annoying, as it is not like it is an error if you
give "--mailmap" and then say "--no-mailmap" later on the same
command line---it's just the usual "last one wins".

I haven't decided what my response to Peff's concern on the fallout
to "rebase --apply".  On one hand, those who conciously choose to
rebase by creating patches and applying them would find it puzzling
if it did not honor format.mailmap setting.  But I would not be
strongly opposed if we hardcoded to pass "--no-mailmap" to the
internal invocation of "format-patch", just like we hardcode "-k"
and other options and justified it with "the use of format-patch is
a mere implementation detail".

Thanks.