summaryrefslogtreecommitdiff
path: root/notes.h
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-02-13 21:28:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-02-14 03:36:11 (GMT)
commita7e7eff66206829f7752c565198dbe6f40ef72a0 (patch)
treee68fe146cab103dc31b158753ca45a6f764bb72f /notes.h
parent0ab1faae39173be6126364461c1be86542e6b17d (diff)
downloadgit-a7e7eff66206829f7752c565198dbe6f40ef72a0.zip
git-a7e7eff66206829f7752c565198dbe6f40ef72a0.tar.gz
git-a7e7eff66206829f7752c565198dbe6f40ef72a0.tar.bz2
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 <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes.h')
-rw-r--r--notes.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/notes.h b/notes.h
index a1421e3..d745ed1 100644
--- a/notes.h
+++ b/notes.h
@@ -4,10 +4,19 @@
/* Free (and de-initialize) the internal notes tree structure */
void free_notes(void);
+/* Flags controlling how notes are formatted */
#define NOTES_SHOW_HEADER 1
#define NOTES_INDENT 2
-void get_commit_notes(const struct commit *commit, struct strbuf *sb,
+/*
+ * Fill the given strbuf with the notes associated with the given object.
+ *
+ * If the internal notes structure is not initialized, it will be auto-
+ * initialized to the default value (see documentation for init_notes() above).
+ *
+ * 'flags' is a bitwise combination of the above formatting flags.
+ */
+void format_note(const unsigned char *object_sha1, struct strbuf *sb,
const char *output_encoding, int flags);
#endif