From a7e7eff66206829f7752c565198dbe6f40ef72a0 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Sat, 13 Feb 2010 22:28:10 +0100 Subject: Notes API: get_commit_notes() -> format_note() + remove the commit restriction There is really no reason why only commit objects can be annotated. By changing the struct commit parameter to get_commit_notes() into a sha1 we gain the ability to annotate any object type. To reflect this in the function naming as well, we rename get_commit_notes() to format_note(). This patch also fixes comments and variable names throughout notes.c as a consequence of the removal of the unnecessary 'commit' restriction. Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- pretty.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pretty.c') diff --git a/pretty.c b/pretty.c index d493cade26..076b918b52 100644 --- a/pretty.c +++ b/pretty.c @@ -775,8 +775,8 @@ static size_t format_commit_one(struct strbuf *sb, const char *placeholder, } return 0; /* unknown %g placeholder */ case 'N': - get_commit_notes(commit, sb, git_log_output_encoding ? - git_log_output_encoding : git_commit_encoding, 0); + format_note(commit->object.sha1, sb, git_log_output_encoding ? + git_log_output_encoding : git_commit_encoding, 0); return 1; } @@ -1095,8 +1095,8 @@ void pretty_print_commit(enum cmit_fmt fmt, const struct commit *commit, strbuf_addch(sb, '\n'); if (context->show_notes) - get_commit_notes(commit, sb, encoding, - NOTES_SHOW_HEADER | NOTES_INDENT); + format_note(commit->object.sha1, sb, encoding, + NOTES_SHOW_HEADER | NOTES_INDENT); free(reencoded); } -- cgit v1.2.3