summaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-10-17 18:51:47 -0700
committerJunio C Hamano <gitster@pobox.com>2012-10-17 22:42:40 -0700
commitddf333f66cb8b8647a40e5d39731eaf63ee9fd44 (patch)
treecae4a18b3024dc5c4330e6b8b923d3915fa161e3 /pretty.c
parent76141e2e6280101362c3c5ddb22699b6f0458100 (diff)
downloadgit-ddf333f66cb8b8647a40e5d39731eaf63ee9fd44.tar.gz
pretty: prepare notes message at a centralized place
Instead of passing a boolean show_notes around, pass an optional string that is to be inserted after the log message proper is shown. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/pretty.c b/pretty.c
index 735cf0fec3..a53eb532aa 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1033,9 +1033,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder,
}
return 0; /* unknown %g placeholder */
case 'N':
- if (c->pretty_ctx->show_notes) {
- format_display_notes(commit->object.sha1, sb,
- get_log_output_encoding(), 1);
+ if (c->pretty_ctx->notes_message) {
+ strbuf_addstr(sb, c->pretty_ctx->notes_message);
return 1;
}
return 0;
@@ -1418,8 +1417,8 @@ void pretty_print_commit(const struct pretty_print_context *pp,
if (pp->fmt == CMIT_FMT_EMAIL && sb->len <= beginning_of_body)
strbuf_addch(sb, '\n');
- if (pp->show_notes)
- format_display_notes(commit->object.sha1, sb, encoding, 0);
+ if (pp->notes_message && *pp->notes_message)
+ strbuf_addstr(sb, pp->notes_message);
free(reencoded);
}