summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-04-18 21:31:29 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-04-18 21:31:29 -0700
commit779f9467ebcd345e60118db89e2c0a4b38204607 (patch)
treebaa2358b904b55580ab4f07488ebcd16051775e5 /builtin
parentMerge branch 'maint' (diff)
parentt3301: add tests to use --format="%N" (diff)
downloadtgif-779f9467ebcd345e60118db89e2c0a4b38204607.tar.xz
Merge branch 'jg/auto-initialize-notes-with-percent-n-in-format'
* jg/auto-initialize-notes-with-percent-n-in-format: t3301: add tests to use --format="%N" pretty: Initialize notes if %N is used
Diffstat (limited to 'builtin')
-rw-r--r--builtin/log.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/builtin/log.c b/builtin/log.c
index b706a5ff88..6208703c06 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -36,6 +36,7 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
{
int i;
int decoration_style = 0;
+ struct userformat_want w;
rev->abbrev = DEFAULT_ABBREV;
rev->commit_format = CMIT_FMT_DEFAULT;
@@ -58,7 +59,10 @@ static void cmd_log_init(int argc, const char **argv, const char *prefix,
usage(builtin_log_usage);
argc = setup_revisions(argc, argv, rev, opt);
- if (!rev->show_notes_given && !rev->pretty_given)
+ memset(&w, 0, sizeof(w));
+ userformat_find_requirements(NULL, &w);
+
+ if (!rev->show_notes_given && (!rev->pretty_given || w.notes))
rev->show_notes = 1;
if (rev->show_notes)
init_display_notes(&rev->notes_opt);