[PATCH 2/3] revision.h: rename struct member to reflect notes role
From: <hidden>
Date: 2026-08-24 20:36:39
Subsystem:
the rest · Maintainer:
Linus Torvalds
From: Kristoffer Haugsbakk <redacted>
The `struct rev_info` member `rdiff_log_arg` is only used to pass
`--[no-]notes` options to git-range-diff(1), which in turn passes it
on to git-log(1). The “log” in the name is fine since other code paths
could choose to use it to pass something else on to git-range-diff(1)
(as long as it makes sense to git-log(1)). However, we will in the next
commit change `revision.c:handle_revision_opt` to push and clear this
`strvec` based on notes options that the user passes. That means that
only one type of git-log(1) option will be suitable for it. So let’s
rename it to `rdiff_notes_arg`.
This structure member got its “log” name in 85bd88a7 (revision: add
rdiff_log_arg to rev_info, 2025-09-25), which was based on the renaming
of the `range-diff.c` variable `other_arg` to `log_arg`.[1] Now, in
`range-diff.c` this `log_arg` really is used for multiple different
git-log(1) options, namely `--[no-]notes` and `--remerge-diff`. But we
can keep this `rev_info` member notes-only.
† 1: in 71fd6c69 (range-diff: rename other_arg to log_arg, 2025-09-25)
Signed-off-by: Kristoffer Haugsbakk <redacted>
---
Notes (testing):
just compile tested
builtin/log.c | 10 +++++-----
log-tree.c | 2 +-
revision.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/builtin/log.c b/builtin/log.c
index 560af00e2fd..28a93c45463 100644
--- a/builtin/log.c
+++ b/builtin/log.c@@ -1336,15 +1336,15 @@ static int get_notes_refs(struct string_list_item *item, void *arg) static void get_notes_args(struct rev_info *rev) { if (!rev->show_notes) { - strvec_push(&rev->rdiff_log_arg, "--no-notes"); + strvec_push(&rev->rdiff_notes_arg, "--no-notes"); } else if (rev->notes_opt.use_default_notes > 0 || (rev->notes_opt.use_default_notes == -1 && !rev->notes_opt.extra_notes_refs.nr)) { - strvec_push(&rev->rdiff_log_arg, "--notes"); + strvec_push(&rev->rdiff_notes_arg, "--notes"); } else { for_each_string_list(&rev->notes_opt.extra_notes_refs, get_notes_refs, - &rev->rdiff_log_arg); + &rev->rdiff_notes_arg); } }
@@ -1475,7 +1475,7 @@ static void make_cover_letter(struct rev_info *rev, int use_separate_file, .dual_color = 1, .max_memory = RANGE_DIFF_MAX_MEMORY_DEFAULT, .diffopt = &opts, - .log_arg = &rev->rdiff_log_arg + .log_arg = &rev->rdiff_notes_arg }; repo_diff_setup(the_repository, &opts);
@@ -2569,7 +2569,7 @@ int cmd_format_patch(int argc, rev.diffopt.no_free = 0; release_revisions(&rev); format_config_release(&cfg); - strvec_clear(&rev.rdiff_log_arg); + strvec_clear(&rev.rdiff_notes_arg); return 0; }
diff --git a/log-tree.c b/log-tree.c
index 83a3c4bf9b1..fd6ddf32af4 100644
--- a/log-tree.c
+++ b/log-tree.c@@ -718,7 +718,7 @@ static void show_diff_of_diff(struct rev_info *opt) .dual_color = 1, .max_memory = RANGE_DIFF_MAX_MEMORY_DEFAULT, .diffopt = &opts, - .log_arg = &opt->rdiff_log_arg + .log_arg = &opt->rdiff_notes_arg }; memcpy(&dq, &diff_queued_diff, sizeof(diff_queued_diff));
diff --git a/revision.h b/revision.h
index acf6d06b241..39cca04d9e5 100644
--- a/revision.h
+++ b/revision.h@@ -351,7 +351,7 @@ struct rev_info { /* range-diff */ const char *rdiff1; const char *rdiff2; - struct strvec rdiff_log_arg; + struct strvec rdiff_notes_arg; int creation_factor; const char *rdiff_title;
@@ -432,7 +432,7 @@ struct rev_info { .expand_tabs_in_log = -1, \ .commit_format = CMIT_FMT_DEFAULT, \ .expand_tabs_in_log_default = 8, \ - .rdiff_log_arg = STRVEC_INIT, \ + .rdiff_notes_arg = STRVEC_INIT, \ } /**
--
2.55.0.13.g85d2d65e389