From: Antoine Pelisse <apelisse@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: Re: [PATCH] commit: search author pattern against mailmap
Date: Sun, 25 Aug 2013 15:37:24 +0200 [thread overview]
Message-ID: <CALWbr2zfpZYGri9aGL3DGhadnYF=0xx_h95ZjN7S4beoAES68A@mail.gmail.com> (raw)
In-Reply-To: <20130825103041.GB12556@sigill.intra.peff.net>
On Sun, Aug 25, 2013 at 12:30 PM, Jeff King <peff@peff.net> wrote:
> On Sun, Aug 25, 2013 at 12:01:29PM +0200, Antoine Pelisse wrote:
>
>> So I kept clear_mailmap() where you put it, but I think it could be moved
>> right after get_revision(). That is because I think format_commit_message()
>> will run another read_mailmap() with an heap-allocated string_list.
>> Anyway, I'm not sure it makes a big difference here.
>
> Yeah, format_commit_message does not even pay attention to our
> revs.mailmap.
>
> It does make me wonder if there should simply be a static singleton
> mailmap that gets loaded once per program invocation and then cleaned up
> at exit. That is clearly what format_commit_message is doing. Is there
> actually a use case for having a custom one in rev_info? It's not like
> you can even control where it reads from when you call read_mailmap.
>
> I guess we need it as a boolean "do we want to mailmap at all" for the
> regular pretty formats, but it could just be a flag in rev_info instead
> of a pointer.
So we would stop passing mailmap string_list along down to map_user(),
and the mailmap file (or blob) would be read the first time it's
needed, and stored in a static global variable in mailmap.c. I think
I'm OK with that because I don't think it would make sense to have
multiple instances of a mailmap string_list in the same git-command
instance.
Who would be responsible for deleting the string_list ? It would
either be done in each command, or done through a atexit(3) registered
function (but then, why would we even care about cleaning it up?).
next prev parent reply other threads:[~2013-08-25 13:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-23 13:48 [PATCH] git-commit: search author pattern against mailmap Antoine Pelisse
2013-08-23 17:44 ` Junio C Hamano
2013-08-23 18:35 ` Jeff King
2013-08-23 19:03 ` Junio C Hamano
2013-08-23 19:47 ` Antoine Pelisse
2013-08-23 20:44 ` Junio C Hamano
2013-08-24 14:07 ` [PATCH] commit: " Antoine Pelisse
2013-08-25 4:01 ` Jeff King
2013-08-25 5:16 ` Junio C Hamano
2013-08-25 9:47 ` Antoine Pelisse
2013-08-25 10:01 ` Antoine Pelisse
2013-08-25 10:30 ` Jeff King
2013-08-25 13:37 ` Antoine Pelisse [this message]
2013-08-25 16:51 ` Jeff King
2013-08-25 20:42 ` Antoine Pelisse
2013-08-26 5:27 ` Junio C Hamano
2013-08-26 21:38 ` Jeff King
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='CALWbr2zfpZYGri9aGL3DGhadnYF=0xx_h95ZjN7S4beoAES68A@mail.gmail.com' \
--to=apelisse@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).