Re: [PATCH 3/3] format-patch: learn --[no-]range-diff-notes
From: Junio C Hamano <hidden>
Date: 2026-09-09 19:04:26
"Kristoffer Haugsbakk" [off-list ref] writes:
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.
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).