diff options
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/revision.c b/revision.c index 0ae1c76db3..219dc76716 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=") && @@ -2788,13 +2790,13 @@ static int handle_revision_pseudo_opt(struct rev_info *revs, } static void read_revisions_from_stdin(struct rev_info *revs, - struct strvec *prune, - int *flags) + struct strvec *prune) { struct strbuf sb; int seen_dashdash = 0; int seen_end_of_options = 0; int save_warning; + int flags = 0; save_warning = warn_on_object_refname_ambiguity; warn_on_object_refname_ambiguity = 0; @@ -2817,13 +2819,13 @@ static void read_revisions_from_stdin(struct rev_info *revs, continue; } - if (handle_revision_pseudo_opt(revs, argv, flags) > 0) + if (handle_revision_pseudo_opt(revs, argv, &flags) > 0) continue; die(_("invalid option '%s' in --stdin mode"), sb.buf); } - if (handle_revision_arg(sb.buf, revs, 0, + if (handle_revision_arg(sb.buf, revs, flags, REVARG_CANNOT_BE_FILENAME)) die("bad revision '%s'", sb.buf); } @@ -2906,7 +2908,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s } if (revs->read_from_stdin++) die("--stdin given twice?"); - read_revisions_from_stdin(revs, &prune_data, &flags); + read_revisions_from_stdin(revs, &prune_data); continue; } @@ -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; } |