if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
rev->show_notes = 1;
if (rev->show_notes)
- init_display_notes(&rev->notes_opt);
+ load_display_notes(&rev->notes_opt);
if ((rev->diffopt.pickaxe_opts & DIFF_PICKAXE_KINDS_MASK) ||
rev->diffopt.filter || rev->diffopt.flags.follow_renames)
static const char *signature_file;
static int config_cover_letter;
static const char *config_output_directory;
+static int show_notes;
+static struct display_notes_opt notes_opt;
enum {
COVER_UNSET,
from = NULL;
return 0;
}
+ if (!strcmp(var, "format.notes")) {
+ int b = git_parse_maybe_bool(value);
+ if (b < 0)
+ enable_ref_display_notes(¬es_opt, &show_notes, value);
+ else if (b)
+ enable_default_display_notes(¬es_opt, &show_notes);
+ else
+ disable_display_notes(¬es_opt, &show_notes);
+ return 0;
+ }
return git_log_config(var, value, cb);
}
extra_to.strdup_strings = 1;
extra_cc.strdup_strings = 1;
init_log_defaults();
+ init_display_notes(¬es_opt);
git_config(git_format_config, NULL);
repo_init_revisions(the_repository, &rev, prefix);
+ rev.show_notes = show_notes;
+ memcpy(&rev.notes_opt, ¬es_opt, sizeof(notes_opt));
rev.commit_format = CMIT_FMT_EMAIL;
rev.expand_tabs_in_log_default = 0;
rev.verbose_header = 1;
rev.diffopt.flags.binary = 1;
if (rev.show_notes)
- init_display_notes(&rev.notes_opt);
+ load_display_notes(&rev.notes_opt);
if (!output_directory && !use_stdout)
output_directory = config_output_directory;