git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Antoine Pelisse <apelisse@gmail.com>
Date
Aug 25, 2013, 13:37 UTC
Message-ID
<CALWbr2zfpZYGri9aGL3DGhadnYF=0xx_h95ZjN7S4beoAES68A@mail.gmail.com>
In-Reply-To
<20130825103041.GB12556@sigill.intra.peff.net>
On Sun, Aug 25, 2013 at 12:30 PM, Jeff King <peff@peff.net> wrote:
Show 19 quoted lines
> 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?).

Previous: Jeff KingNext: Jeff King
Message 13 of 17 in “git-commit: search author pattern against mailmap”
  1. git-commit: search author pattern against mailmapAntoine Pelisse, Aug 23, 2013
  2. Junio C HamanoAug 23, 2013
  3. Jeff KingAug 23, 2013
  4. Junio C HamanoAug 23, 2013
  5. Antoine PelisseAug 23, 2013
  6. Junio C HamanoAug 23, 2013
  7. commit: search author pattern against mailmapAntoine Pelisse, Aug 24, 2013
  8. Jeff KingAug 25, 2013
  9. Junio C HamanoAug 25, 2013
  10. Antoine PelisseAug 25, 2013
  11. commit: search author pattern against mailmapAntoine Pelisse, Aug 25, 2013
  12. Jeff KingAug 25, 2013
  13. Antoine PelisseAug 25, 2013
  14. Jeff KingAug 25, 2013
  15. Antoine PelisseAug 25, 2013
  16. Junio C HamanoAug 26, 2013
  17. Jeff KingAug 26, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.