From 56881843d4d916a166ac4c6ba1803e5ceba9c44d Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Tue, 9 Nov 2010 22:49:47 +0100 Subject: builtin/notes.c: Refactor creation of notes commits. Create new function create_notes_commit() which is slightly more general than commit_notes() (accepts multiple commit parents and does not auto-update the notes ref). This function will be used by the notes-merge functionality in future patches. Also rewrite builtin/notes.c:commit_notes() to reuse this new function. Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- notes-merge.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'notes-merge.h') diff --git a/notes-merge.h b/notes-merge.h index fd572ac35c..49e1b3a0f2 100644 --- a/notes-merge.h +++ b/notes-merge.h @@ -14,6 +14,20 @@ struct notes_merge_options { void init_notes_merge_options(struct notes_merge_options *o); +/* + * Create new notes commit from the given notes tree + * + * Properties of the created commit: + * - tree: the result of converting t to a tree object with write_notes_tree(). + * - parents: the given parents OR (if NULL) the commit referenced by t->ref. + * - author/committer: the default determined by commmit_tree(). + * - commit message: msg + * + * The resulting commit SHA1 is stored in result_sha1. + */ +void create_notes_commit(struct notes_tree *t, struct commit_list *parents, + const char *msg, unsigned char *result_sha1); + /* * Merge notes from o->remote_ref into o->local_ref * -- cgit v1.2.3