aboutsummaryrefslogtreecommitdiffstats
path: root/revision.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-09-29 09:04:15 -0700
committerJunio C Hamano <gitster@pobox.com>2023-09-29 09:04:15 -0700
commit5cd3f68add3cf24c322f925a5ca05a278bc6c027 (patch)
tree2aeb289c520081aa9e8873808990f366fa468a5e /revision.c
parentMerge branch 'ds/stat-name-width-configuration' (diff)
parentrange-diff: treat notes like `log` (diff)
downloadgit-5cd3f68add3cf24c322f925a5ca05a278bc6c027.tar.gz
git-5cd3f68add3cf24c322f925a5ca05a278bc6c027.zip
Merge branch 'kh/range-diff-notes'
"git range-diff --notes=foo" compared "log --notes=foo --notes" of the two ranges, instead of using just the specified notes tree. * kh/range-diff-notes: range-diff: treat notes like `log`
Diffstat (limited to 'revision.c')
-rw-r--r--revision.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/revision.c b/revision.c
index 2f4c53ea20..49d385257a 100644
--- a/revision.c
+++ b/revision.c
@@ -2484,6 +2484,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
revs->break_bar = xstrdup(optarg);
revs->track_linear = 1;
revs->track_first_time = 1;
+ } else if (!strcmp(arg, "--show-notes-by-default")) {
+ revs->show_notes_by_default = 1;
} else if (skip_prefix(arg, "--show-notes=", &optarg) ||
skip_prefix(arg, "--notes=", &optarg)) {
if (starts_with(arg, "--show-notes=") &&
@@ -3054,6 +3056,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
if (revs->expand_tabs_in_log < 0)
revs->expand_tabs_in_log = revs->expand_tabs_in_log_default;
+ if (!revs->show_notes_given && revs->show_notes_by_default) {
+ enable_default_display_notes(&revs->notes_opt, &revs->show_notes);
+ revs->show_notes_given = 1;
+ }
+
return left;
}