Re: [PATCH v1 1/1] cat-file: add use-mailmap/no-use-mailmap to --batch-command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 29, 2026, 20:55 UTC
- Message-ID
- <xmqqh5pygxu4.fsf@gitster.g>
- In-Reply-To
- <a4ec7bfa-f16b-4505-9b37-d3dd137e93cb@gmail.com>
Siddharth Asthana <siddharthasthana31@gmail.com> 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.