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

[PATCH 2/3] revision.h: rename struct member to reflect notes role

From
Kkristofferhaugsbakk@fastmail.com <kristofferhaugsbakk@fastmail.com>
Date
Aug 24, 2026, 20:35 UTC
Message-ID
<member_rdiff_notes_arg.c59@msgid.xyz>
In-Reply-To
<CV_format-patch_learn_--range-diff-notes.c57@msgid.xyz>
From: Kristoffer Haugsbakk <code@khaugsbakk.name>

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 <code@khaugsbakk.name>
---
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
Previous: kristofferhaugsbakk@fastmail.comNext: kristofferhaugsbakk@fastmail.com
Message 3 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.