]> git.ipfire.org Git - thirdparty/git.git/commit
revision: add rdiff_log_arg to rev_info
authorKristoffer Haugsbakk <code@khaugsbakk.name>
Thu, 25 Sep 2025 17:07:35 +0000 (19:07 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Sep 2025 18:34:12 +0000 (11:34 -0700)
commit85bd88a7e8a8f7cd7c99b9db4a10b7a29498d258
tree5bba35884fe186e0983a299565b7d3bf301e1055
parent71fd6c695cd9fc9cc0a829d1579c7584c2ad9e18
revision: add rdiff_log_arg to rev_info

git-format-patch(1) supports Git notes by showing them beneath the
patch/commit message, similar to git-log(1). The command also supports
showing those same notes ref names in the range diff output.

Note *the same* ref names; any Git notes options or configuration
variables need to be handed off to the range-diff machinery. This works
correctly in the case when the range diff is on the cover letter. But it
does not work correctly when the output is a single patch with an
embedded range diff.

Concretely, git-format-patch(1) needs to pass `--[no-]notes` options
on to the range-diff subprocess in `range-diff.c`. This is handled in
`builtin/log.c` by the local variable `log_arg` in the case of mul-
tiple commits, but not in the single commit case where there is no
cover letter and the range diff is embedded in the patch output; the
range diff is then made in `log-tree.c`, whither `log_arg` has not
been propagated. This means that the range-diff subprocess reverts
to its default behavior, which is to act like git-log(1) w.r.t. notes.

We need to fix this. But first lay the groundwork by converting
`log_arg` to a struct member; next we can simply use that member
in `log-tree.c` without having to thread it from `builtin/log.c`.

No functional changes.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/log.c
revision.h