git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: Oddidies in the .mailmap parser & future syntax extensions
Date: Mon, 13 Sep 2021 06:02:09 +0200	[thread overview]
Message-ID: <87zgsh3ylo.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqk0jorxmx.fsf@gitster.g>


On Fri, Sep 10 2021, Junio C Hamano wrote:

> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> Who wants to use mailmap, *and* map one e-mail address to another, *and*
>> has an entry explicitly mapping the name, but *would* mind having git be
>> auto-smart and follow the chain of that explicit name mapping if there's
>> an entry after that with an an e-mail -> that-earlier-email mapping?
>
> Would it make a difference if I point out that at least for our
> project, we want to keep the .mailmap lines be sorted?

I just used git.git as a handy example. If the project wants to not use
some new shorthand syntax to make for easy sorting it can just not use
it. I don't think that should be an argument against the existence of
such a syntax for those who'd like it.

> I suspect that a "list must be mechanically sorted" requirement may
> make it awkward to also have an "if name is missing, use the last
> matching explicit name".  Also, it makes removing one entry among many
> for the same person less straight-forward (if you are removing the one
> that happens to be listed first, you need to move the name to the next
> entry in order to avoid losing it).

That's a good point, that E-Mail was written rather off-hand, and I see
from find_last_name_for_address_in_mailmap() that I probably had that
ordering in mind.

But given that point I think a shorthand like that would be equally or
more useful if we don't care about the order, the "more" being because
you'd be able to sort it in any way you like and still get the same
results.

I.e. when mapping:

    <gitster@pobox.com> <junio@hera.kernel.org>
    <gitster@pobox.com> <junio@kernel.org>

We'll have fully parsed the file, and having also seen:

    Junio C Hamano <gitster@pobox.com> <gitster@pobox.com>

We can follow the chain and see that since <gitster@pobox.com> has
explicit wanted name mapping, that we should use that for say
<junio@kernel.org>, because it wants to map to <gitster@pobox.com>, so
it should also get the name mapping.

Except if we had more than one name mapping, but that could/should also
be detected regardless of order.

      reply	other threads:[~2021-09-13  4:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-10 13:02 [PATCH] .mailmap: Update mailmap Fangyi Zhou
2021-09-10 15:22 ` Gwyneth Morgan
2021-09-10 15:31   ` Jeff King
2021-09-10 15:35     ` Sibi Siddharthan
2021-09-11  0:32     ` Junio C Hamano
2021-09-11  1:31       ` Ævar Arnfjörð Bjarmason
2021-09-11 14:52         ` Jeff King
2021-09-11 14:47       ` Jeff King
2021-09-10 16:48   ` Oddidies in the .mailmap parser & future syntax extensions Ævar Arnfjörð Bjarmason
2021-09-10 18:11     ` Junio C Hamano
2021-09-10 19:50       ` Ævar Arnfjörð Bjarmason
2021-09-10 20:20         ` Junio C Hamano
2021-09-13  4:02           ` Ævar Arnfjörð Bjarmason [this message]

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=87zgsh3ylo.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).