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

[PATCH 0/2] cat-file: support NUL-delimited input with `-z`

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 22, 2022, 23:28 UTC
Message-ID
<cover.1658532524.git.me@ttaylorr.com>

This short patch series implements a `-z` mode that is compatible with the `--batch`, `--batch-check`, and new `--batch-command` options in `cat-file`.

This came out of a request from a colleague to support `cat-file` invocations that refer to a tree entry whose name includes a newline character.

The implementation is mostly straightforward, though the second patch (which contains the main substance of this change) has a few additional thoughts on areas for future cleanup. The first patch is preparatory, but could easily be squashed, too.

Thanks in advance for your review!
Taylor Blau (2):
  t1006: extract --batch-command inputs to variables
  builtin/cat-file.c: support NUL-delimited input with `-z`
 Documentation/git-cat-file.txt |  7 +++-
 builtin/cat-file.c             | 28 +++++++++++--
 t/t1006-cat-file.sh            | 72 +++++++++++++++++++++++++++-------
 3 files changed, 88 insertions(+), 19 deletions(-)
-- 
2.37.0.1.g1379af2e9d
Next: Taylor Blau
Message 1 of 15 in “cat-file: support NUL-delimited input with `-z`”
  1. 0/2 cat-file: support NUL-delimited input with `-z`Taylor Blau, Jul 22, 2022
  2. 1/2 t1006: extract --batch-command inputs to variablesTaylor Blau, Jul 22, 2022
  3. 2/2 builtin/cat-file.c: support NUL-delimited input with `-z`Taylor Blau, Jul 22, 2022
  4. Chris TorekJul 22, 2022
  5. Taylor BlauJul 25, 2022
  6. Junio C HamanoJul 23, 2022
  7. Taylor BlauJul 25, 2022
  8. Junio C HamanoJul 27, 2022
  9. Ævar Arnfjörð BjarmasonJul 23, 2022
  10. Junio C HamanoJul 23, 2022
  11. Taylor BlauJul 25, 2022
  12. Junio C HamanoJul 27, 2022
  13. Phillip WoodJul 31, 2022
  14. Ævar Arnfjörð BjarmasonAug 11, 2022
  15. Junio C HamanoJul 23, 2022

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.