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

[PATCH 0/2] name-rev: learn --format=<pretty>

From
Kkristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
Date
Mar 13, 2026, 16:03 UTC
Message-ID
<CV_name-rev_--format.4ad@msgid.xyz>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
Topic name: kh/name-rev-pretty-format

Topic summary: Teach git-name-rev(1) a mode to pretty format revisions instead of outputting symbolic names.

(See the second patch for details.)
The first patch is just for `CodingGuidelines`. Unrelated.

I have gone through three approaches: pretty print, `log-tree: log_tree_commit`, and pretty print again. At first I was confused when using `pretty_print_commit` because I couldn’t seem to get the same output as git-log(1):

    # for git-log(1)
    git log --format=<pretty>
    # for git-name-rev(1)
    git rev-list HEAD |
        git name-rev --format=<pretty> --annotate-stdin
Because there were some minor differences for a few things I tried:

• fuller: log has the `commit <commit>` header; pretty does not • oneline: log has the oid; pretty does not

Then I tried `log_tree_commit`. But then I got some things that I didn’t want. This function also didn’t fit in with the git-name-rev(1) processing since it just dumps straight to standard out instead of allowing you to accumulate things in a scratch buffer (strbuf). So then I went back to the `pretty_print_commit` approach.

Notes are handled by reading the display refs. I can imagine that it would be better for this command to use `--[no-]notes` arguments like the ones that git-log(1) has for explicit control (without using env. variables).

[1/2] name-rev: wrap both blocks in braces [2/2] name-rev: learn --format=<pretty>

 Documentation/git-name-rev.adoc |  9 +++-
 builtin/name-rev.c              | 85 ++++++++++++++++++++++++++++-----
 t/t6120-describe.sh             | 58 ++++++++++++++++++++++
 3 files changed, 139 insertions(+), 13 deletions(-)
base-commit: 67006b9db8b772423ad0706029286096307d2567
-- 
2.53.0.32.gf6228eaf9cc
Next: kristofferhaugsbakk@fastmail.com
Message 1 of 45 in “name-rev: learn --format=<pretty>”
  1. 0/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 13, 2026
  2. 1/2 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Mar 13, 2026
  3. Junio C HamanoMar 14, 2026
  4. Kristoffer HaugsbakkMar 17, 2026
  5. 2/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 13, 2026
  6. Junio C HamanoMar 14, 2026
  7. Kristoffer HaugsbakkMar 17, 2026
  8. Kristoffer HaugsbakkMar 18, 2026
  9. 0/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 20, 2026
  10. 1/2 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Mar 20, 2026
  11. 2/2 name-rev: learn --format=<pretty>kristofferhaugsbakk@fastmail.com, Mar 20, 2026
  12. D. Ben KnobleMar 20, 2026
  13. Kristoffer HaugsbakkMar 23, 2026
  14. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  15. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, Apr 28, 2026
  16. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, Apr 28, 2026
  17. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  18. Phillip WoodApr 30, 2026
  19. kristofferhaugsbakk@fastmail.comMay 1, 2026
  20. Phillip WoodMay 2, 2026
  21. Kristoffer HaugsbakkMay 5, 2026
  22. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  23. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, Apr 28, 2026
  24. Kristoffer HaugsbakkApr 29, 2026
  25. Kristoffer HaugsbakkApr 30, 2026
  26. Kristoffer HaugsbakkApr 30, 2026
  27. Phillip WoodMay 1, 2026
  28. kristofferhaugsbakk@fastmail.comMay 1, 2026
  29. Phillip WoodMay 2, 2026
  30. Kristoffer HaugsbakkMay 5, 2026
  31. Junio C HamanoMay 3, 2026
  32. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 7, 2026
  33. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, May 7, 2026
  34. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, May 7, 2026
  35. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, May 7, 2026
  36. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, May 7, 2026
  37. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 7, 2026
  38. Kristoffer HaugsbakkMay 8, 2026
  39. Kristoffer HaugsbakkMay 11, 2026
  40. 0/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 11, 2026
  41. 1/5 name-rev: wrap both blocks in braceskristofferhaugsbakk@fastmail.com, May 11, 2026
  42. 2/5 name-rev: run clang-format before factoring codekristofferhaugsbakk@fastmail.com, May 11, 2026
  43. 3/5 name-rev: factor code for sharing with a new commandkristofferhaugsbakk@fastmail.com, May 11, 2026
  44. 4/5 name-rev: make dedicated --annotate-stdin --name-only testkristofferhaugsbakk@fastmail.com, May 11, 2026
  45. 5/5 format-rev: introduce builtin for on-demand pretty formattingkristofferhaugsbakk@fastmail.com, May 11, 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.