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

[PATCH 0/2] format-patch: handle range-diff on notes correctly for single patches

From
Kkristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
Date
Sep 22, 2025, 21:10 UTC
Message-ID
<cover.1758574974.git.code@khaugsbakk.name>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>

git-format-patch(1) does not handle Git notes correctly in the range-diff output for single-commit series. It reverts to the default behavior of git-range-diff(1), which is to act like git-log(1).

Fix that notes handling to always output the same notes (namespaces) in the two positions:

• beneath the commit message; and • in the range-diff.

Do that by (patch by patch):
1. Refactoring to use a new `ref_info` struct member
2. Using that in `log-tree.c`
§ Testing

I have (for once) tried to check for leaks by running the test suite with this `config.mak`:

``` DEVELOPER=1 DEBUG=1 CC = ccache gcc CFLAGS+=-O0 CFLAGS+=-ggdb3 USE_ASCIIDOCTOR=true SANITIZE=leak,address ```

Kristoffer Haugsbakk (2):
  revision: add rdiff_other_arg to rev_info
  format-patch: handle range-diff on notes correctly for single patches
 builtin/log.c         |  7 +++----
 log-tree.c            |  3 ++-
 revision.h            |  1 +
 t/t3206-range-diff.sh | 16 +++++++++++++++-
 4 files changed, 21 insertions(+), 6 deletions(-)
base-commit: ca2559c1d630eb4f04cdee2328aaf1c768907a9e
-- 
2.51.0.270.gdb73cbc1bc1
Next: kristofferhaugsbakk@fastmail.com
Message 1 of 15 in “format-patch: handle range-diff on notes correctly for single patches”
  1. 0/2 format-patch: handle range-diff on notes correctly for single patcheskristofferhaugsbakk@fastmail.com, Sep 22, 2025
  2. 1/2 revision: add rdiff_other_arg to rev_infokristofferhaugsbakk@fastmail.com, Sep 22, 2025
  3. Junio C HamanoSep 22, 2025
  4. Kristoffer HaugsbakkSep 23, 2025
  5. Junio C HamanoSep 23, 2025
  6. Kristoffer HaugsbakkSep 23, 2025
  7. Junio C HamanoSep 23, 2025
  8. 2/2 format-patch: handle range-diff on notes correctly for single patcheskristofferhaugsbakk@fastmail.com, Sep 22, 2025
  9. Junio C HamanoSep 22, 2025
  10. Kristoffer HaugsbakkSep 23, 2025
  11. Junio C HamanoSep 23, 2025
  12. 0/3 format-patch: handle range-diff on notes correctly for single patcheskristofferhaugsbakk@fastmail.com, Sep 25, 2025
  13. 1/3 range-diff: rename other_arg to log_argkristofferhaugsbakk@fastmail.com, Sep 25, 2025
  14. 2/3 revision: add rdiff_log_arg to rev_infokristofferhaugsbakk@fastmail.com, Sep 25, 2025
  15. 3/3 format-patch: handle range-diff on notes correctly for single patcheskristofferhaugsbakk@fastmail.com, Sep 25, 2025

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.