Subject: Re: [PATCH v1 1/1] cat-file: add use-mailmap/no-use-mailmap to --batch-command

From: Junio C Hamano <[email-masked]>
Date: Sun, 29 Mar 2026 13:55:15 -0700

Siddharth Asthana <[email-masked]> writes:

>> And the cached information in process, if any, would be flushed?
>
> No. The mailmap data is kept in memory. Turning it off only disables 
> application of mailmap; turning it back on reuses already loaded data.

I was asking if the rewritten commmit objects were kept around in
memory and how long; after you show an object once with mapped
author data, toggled the mailmap use, and then try to show the same
object again, you would want to avoid reusing the mapped result
again.

But it turns out that the command, with or without your patch, reads
the object data and maps the author/commit in it every time an
object is requested.  In fact, in a bad case, I think it calls
replace_idents_using_mailmap() twice, once in batch_object_write()
only to grab the size of the munged object, then again in
print_object_or_die() for both contents and the size.

So there is no "tainted data retained across the mode switch"
problem.