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

[PATCH v5 0/1] cat-file: add mailmap subcommand to --batch-command

From
Siddharth Asthana <siddharthasthana31@gmail.com>
Date
Apr 16, 2026, 03:32 UTC
Message-ID
<20260416033250.4327-1-siddharthasthana31@gmail.com>
In-Reply-To
<20260415150943.40493-1-siddharthasthana31@gmail.com>

git-cat-file(1)'s --batch-command works with the --use-mailmap option, but this option needs to be set when the process is created. This means we cannot change this option mid-operation.

At GitLab, Gitaly keeps interacting with a long-lived git-cat-file process and it would be useful if --batch-command supported toggling mailmap dynamically on an existing process.

This patch adds a `mailmap` subcommand to --batch-command that accepts a boolean argument and toggles mailmap dynamically for subsequent commands.

The series is based on top of 5361983c07 (The 22nd batch, 2026-03-21).
CI: https://gitlab.com/gitlab-org/git/-/pipelines/2456596910
Changes in v5:
- Simplify documentation: remove the `;;` sub-list describing
  `true`/`false` effects and replace with a single sentence noting
  that mailmap data is read upon the first use and only once.
- Link to v4: https://lore.kernel.org/git/20260415150943.40493-1-siddharthasthana31@gmail.com/T/#m5226263dafcf5c774c080a6688e9af0f402003c0
- Link to v3: https://lore.kernel.org/git/xmqqv7dyoei6.fsf@gitster.g/T/#m0a109f3eb5129e619ecec5f2d58ead0c5a49a4f3
- Link to v2: https://lore.kernel.org/git/xmqqv7dyoei6.fsf@gitster.g/T/#m445eab3b309bded92d1b130d225b882c73988ff2
- Link to v1: https://public-inbox.org/git/a4ec7bfa-f16b-4505-9b37-d3dd137e93cb@gmail.com/T/#m5c62fb6ad0fbcc99a706dba4c78b66359c247acd

Thanks, Siddharth

---
Siddharth Asthana (1):
  cat-file: add mailmap subcommand to --batch-command
 Documentation/git-cat-file.adoc |   5 ++
 builtin/cat-file.c              |  37 ++++++++++++--
 t/t4203-mailmap.sh              | 105 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 143 insertions(+), 4 deletions(-)
Range-diff versus v4:
1:  25ebffe39e ! 1:  b4d6f08b43 cat-file: add mailmap subcommand to --batch-command
    @@ Documentation/git-cat-file.adoc: flush::
     +`mailmap (<bool>)`::
     +	Enable or disable mailmap for subsequent commands. The `<bool>`
     +	argument accepts the same boolean values as linkgit:git-config[1].
    -+	Possible effects are:
    -++
    -+`true`;;
    -+	Mailmap data is loaded on first use and kept in memory until the
    -+	process exits. Passing `true` again does not reload the data.
    -+`false`;;
    -+	Mailmap replacements are disabled for subsequent commands, but data
    -+	already loaded stays in memory.
    ++	The mailmap data is read upon the first use and only once.
      --
      +
      
base-commit: 5361983c075154725be47b65cca9a2421789e410
-- 
2.53.0
Previous: Siddharth AsthanaNext: Siddharth Asthana
Message 26 of 28 in “cat-file: add use-mailmap/no-use-mailmap to --batch-command”
  1. 1/1 cat-file: add use-mailmap/no-use-mailmap to --batch-commandSiddharth Asthana, Mar 28, 2026
  2. Junio C HamanoMar 29, 2026
  3. Siddharth AsthanaMar 29, 2026
  4. Junio C HamanoMar 29, 2026
  5. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 29, 2026
  6. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 29, 2026
  7. Junio C HamanoMar 30, 2026
  8. Siddharth AsthanaMar 31, 2026
  9. Junio C HamanoMar 31, 2026
  10. Karthik NayakMar 30, 2026
  11. Siddharth AsthanaMar 31, 2026
  12. Patrick SteinhardtMar 30, 2026
  13. Junio C HamanoMar 30, 2026
  14. Siddharth AsthanaMar 31, 2026
  15. Jean-Noël AVILAMar 31, 2026
  16. Junio C HamanoMar 31, 2026
  17. Jean-Noël AvilaApr 1, 2026
  18. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 31, 2026
  19. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Mar 31, 2026
  20. Junio C HamanoMar 31, 2026
  21. Junio C HamanoApr 10, 2026
  22. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 15, 2026
  23. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 15, 2026
  24. Junio C HamanoApr 15, 2026
  25. Siddharth AsthanaApr 16, 2026
  26. 0/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 16, 2026
  27. 1/1 cat-file: add mailmap subcommand to --batch-commandSiddharth Asthana, Apr 16, 2026
  28. Junio C HamanoMay 20, 2026

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.