From: Junio C Hamano Date: Mon, 11 Jul 2016 17:31:08 +0000 (-0700) Subject: Merge branch 'mj/log-show-signature-conf' X-Git-Tag: v2.10.0-rc0~135 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/369dc4081c836bc17ee1debaf6688eb098359760?hp=-c Merge branch 'mj/log-show-signature-conf' "git log" learns log.showSignature configuration variable, and a command line option "--no-show-signature" to countermand it. * mj/log-show-signature-conf: log: add log.showSignature configuration variable log: add "--no-show-signature" command line option t4202: refactor test --- 369dc4081c836bc17ee1debaf6688eb098359760 diff --combined Documentation/git-log.txt index 4a6c47f843,3995324024..32246fdb00 --- a/Documentation/git-log.txt +++ b/Documentation/git-log.txt @@@ -198,12 -198,16 +198,16 @@@ log.showRoot: `git log -p` output would be shown without a diff attached. The default is `true`. + log.showSignature:: + If `true`, `git log` and related commands will act as if the + `--show-signature` option was passed to them. + mailmap.*:: See linkgit:git-shortlog[1]. notes.displayRef:: Which refs, in addition to the default set by `core.notesRef` - or 'GIT_NOTES_REF', to read notes from when showing commit + or `GIT_NOTES_REF`, to read notes from when showing commit messages with the `log` family of commands. See linkgit:git-notes[1]. + @@@ -212,7 -216,7 +216,7 @@@ multiple times. A warning will be issu but a glob that does not match any refs is silently ignored. + This setting can be disabled by the `--no-notes` option, -overridden by the 'GIT_NOTES_DISPLAY_REF' environment variable, +overridden by the `GIT_NOTES_DISPLAY_REF` environment variable, and overridden by the `--notes=` option. GIT diff --combined builtin/log.c index de47b4e89a,7103217505..0b6f7392b9 --- a/builtin/log.c +++ b/builtin/log.c @@@ -33,6 -33,7 +33,7 @@@ static const char *default_date_mode = static int default_abbrev_commit; static int default_show_root = 1; static int default_follow; + static int default_show_signature; static int decoration_style; static int decoration_given; static int use_mailmap_config; @@@ -119,6 -120,7 +120,7 @@@ static void cmd_log_init_defaults(struc rev->abbrev_commit = default_abbrev_commit; rev->show_root_diff = default_show_root; rev->subject_prefix = fmt_patch_subject_prefix; + rev->show_signature = default_show_signature; DIFF_OPT_SET(&rev->diffopt, ALLOW_TEXTCONV); if (default_date_mode) @@@ -409,6 -411,10 +411,10 @@@ static int git_log_config(const char *v use_mailmap_config = git_config_bool(var, value); return 0; } + if (!strcmp(var, "log.showsignature")) { + default_show_signature = git_config_bool(var, value); + return 0; + } if (grep_config(var, value, cb) < 0) return -1; @@@ -674,9 -680,9 +680,9 @@@ static int auto_number = 1 static char *default_attach = NULL; -static struct string_list extra_hdr; -static struct string_list extra_to; -static struct string_list extra_cc; +static struct string_list extra_hdr = STRING_LIST_INIT_NODUP; +static struct string_list extra_to = STRING_LIST_INIT_NODUP; +static struct string_list extra_cc = STRING_LIST_INIT_NODUP; static void add_header(const char *value) { @@@ -953,7 -959,7 +959,7 @@@ static void make_cover_letter(struct re struct pretty_print_context pp = {0}; struct commit *head = list[0]; - if (rev->commit_format != CMIT_FMT_EMAIL) + if (!cmit_fmt_is_mail(rev->commit_format)) die(_("Cover letter needs email format")); committer = git_committer_info(0); diff --combined revision.c index 2f60062876,3546ff9c1b..edba5b79bc --- a/revision.c +++ b/revision.c @@@ -1425,7 -1425,7 +1425,7 @@@ static void prepare_show_merge(struct r ce_same_name(ce, active_cache[i+1])) i++; } - free_pathspec(&revs->prune_data); + clear_pathspec(&revs->prune_data); parse_pathspec(&revs->prune_data, PATHSPEC_ALL_MAGIC & ~PATHSPEC_LITERAL, PATHSPEC_PREFER_FULL | PATHSPEC_LITERAL_PATH, "", prune); revs->limited = 1; @@@ -1871,6 -1871,8 +1871,8 @@@ static int handle_revision_opt(struct r revs->notes_opt.use_default_notes = 1; } else if (!strcmp(arg, "--show-signature")) { revs->show_signature = 1; + } else if (!strcmp(arg, "--no-show-signature")) { + revs->show_signature = 0; } else if (!strcmp(arg, "--show-linear-break") || starts_with(arg, "--show-linear-break=")) { if (starts_with(arg, "--show-linear-break="))