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

Re: [PATCH 3/3] format-patch: learn --[no-]range-diff-notes

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 9, 2026, 19:04 UTC
Message-ID
<xmqqpkymqm9z.fsf@gitster.g>
In-Reply-To
<8f0a076b-4822-44e2-a842-cc1e39ae1c1d@app.fastmail.com>
"Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com> writes:
Show 7 quoted lines
> Side note: using `--range-diff-notes=` (empty arg) to signal no-notes
> would be inconsistent with `--notes`. Those options just take that
> value. Then they inevitably output:
>
>     $ git log --notes=
>     warning: notes ref refs/notes/ is invalid
>     [output]

Ah, I didn't know that one. It sounds like a UI bug we can safely fix without worrying about being backward incompatible.

Show 11 quoted lines
> I don’t understand why you contrast these two approaches:
>
> (I’m using `RD` as a shorthand for `range-diff` again)
>
> 1. `--no-RD-notes` means “revert to whatever `--notes` is up to”, as if
>    no `--[no-]RD-notes` of any kind were ever given
> 2. `--no-RD-notes` means “no range diff/comparison notes at all”
>
> Since (2) was the only design I presented. Is the point that you can use
> these two approaches to eventually find a way to implement the “revert
> to `--notes` behavior”? Well, if so I understand.

No. I thought #1 was what you were doing, which was how I thought was the only way for the command line you suggested in an earlier message would make sense.

    You may want to turn off this notes override behavior after it has been
    activated. Use this sequence to do that:
    +
    ----
    --no-range-diff-notes --range-diff-notes
    ----
    +
    Now the range diff is back to displaying the same notes as the
    patches. Going back to the three `--notes` example: now the range diff
    will show all three notes again.

Under the interpretation #2, the first --no-RD-notes tells us that we won't use notes for comparison, and then the next --RD-notes tells us that we use notes listed as parameter to it (which is "no notes") for comparison, so the "notes override behaviour" is not turned off. We use no notes for comparison, and use the ones that are given with --notes=<note> only for display.

Under the interpretation #1, the first --no-RD-notes would make the command behave as if no --RD-notes were even given, and --notes=<note> would be used both for comparison and display. Then --RD-notes that says there is no particular notes you want for comparison would make the <note> given earlier with --notes=<note> not to be used for comparison. After spelling it out like this, it seems that even #1 does not turn off this notes override behaviour, either. I admit that I wasn't thinking about interpretation #1 too deeply as I wasn't interested in seeing it happen.

So it is good that we agree we want to use the interpretation #2. Which means the "You may want to turn off ..." part of the documentation inaccurate (I think I've already suggested striking it off in an earlier message).

Previous: Kristoffer HaugsbakkNext: kristofferhaugsbakk@fastmail.com
Message 17 of 41 in “format-patch: learn --[no-]range-diff-notes”
  1. 0/3 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Aug 24, 2026
  2. 1/3 format-patch: simplify get_notes_arg parameterskristofferhaugsbakk@fastmail.com, Aug 24, 2026
  3. 2/3 revision.h: rename struct member to reflect notes rolekristofferhaugsbakk@fastmail.com, Aug 24, 2026
  4. 3/3 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Aug 24, 2026
  5. Junio C HamanoAug 24, 2026
  6. Kristoffer HaugsbakkAug 25, 2026
  7. Junio C HamanoAug 28, 2026
  8. Kristoffer HaugsbakkAug 28, 2026
  9. Junio C HamanoAug 28, 2026
  10. Kristoffer HaugsbakkSep 2, 2026
  11. Kristoffer HaugsbakkSep 6, 2026
  12. D. Ben KnobleSep 6, 2026
  13. Kristoffer HaugsbakkSep 6, 2026
  14. D. Ben KnobleSep 6, 2026
  15. Junio C HamanoSep 6, 2026
  16. Kristoffer HaugsbakkSep 9, 2026
  17. Junio C HamanoSep 9, 2026
  18. 0/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Sep 26, 2026
  19. 1/2 format-patch: simplify get_notes_arg parameterskristofferhaugsbakk@fastmail.com, Sep 26, 2026
  20. 2/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Sep 26, 2026
  21. Junio C HamanoSep 27, 2026
  22. Kristoffer HaugsbakkSep 27, 2026
  23. Junio C HamanoSep 28, 2026
  24. Kristoffer HaugsbakkSep 28, 2026
  25. 0/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 2, 2026
  26. 1/2 format-patch: simplify get_notes_arg parameterskristofferhaugsbakk@fastmail.com, Oct 2, 2026
  27. Junio C HamanoOct 2, 2026
  28. Kristoffer HaugsbakkOct 2, 2026
  29. Kristoffer HaugsbakkOct 2, 2026
  30. Kristoffer HaugsbakkOct 2, 2026
  31. 2/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 2, 2026
  32. Junio C HamanoOct 2, 2026
  33. Kristoffer HaugsbakkOct 2, 2026
  34. 0/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 4, 2026
  35. 1/2 format-patch: simplify get_notes_arg parameterskristofferhaugsbakk@fastmail.com, Oct 4, 2026
  36. 2/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 4, 2026
  37. Junio C HamanoOct 4, 2026
  38. Kristoffer HaugsbakkOct 4, 2026
  39. 0/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 4, 2026
  40. 1/2 format-patch: simplify get_notes_arg parameterskristofferhaugsbakk@fastmail.com, Oct 4, 2026
  41. 2/2 format-patch: learn --[no-]range-diff-noteskristofferhaugsbakk@fastmail.com, Oct 4, 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.