Re: [PATCH] commit: search author pattern against mailmap

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 25, 2013 at 12:30 PM, Jeff King <peff@xxxxxxxx> 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?).
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]