Johan Herland | 49c2470 | 2013-06-12 02:13:00 +0200 | [diff] [blame] | 1 | #ifndef NOTES_UTILS_H |
| 2 | #define NOTES_UTILS_H |
| 3 | |
| 4 | #include "notes.h" |
| 5 | |
Johan Herland | bf9a05b | 2013-06-12 02:13:01 +0200 | [diff] [blame] | 6 | /* |
| 7 | * Create new notes commit from the given notes tree |
| 8 | * |
| 9 | * Properties of the created commit: |
| 10 | * - tree: the result of converting t to a tree object with write_notes_tree(). |
| 11 | * - parents: the given parents OR (if NULL) the commit referenced by t->ref. |
Junio C Hamano | a316b95 | 2013-09-04 15:28:45 -0700 | [diff] [blame] | 12 | * - author/committer: the default determined by commit_tree(). |
Johan Herland | bf9a05b | 2013-06-12 02:13:01 +0200 | [diff] [blame] | 13 | * - commit message: msg |
| 14 | * |
| 15 | * The resulting commit SHA1 is stored in result_sha1. |
| 16 | */ |
| 17 | void create_notes_commit(struct notes_tree *t, struct commit_list *parents, |
| 18 | const struct strbuf *msg, unsigned char *result_sha1); |
| 19 | |
Johan Herland | 49c2470 | 2013-06-12 02:13:00 +0200 | [diff] [blame] | 20 | void commit_notes(struct notes_tree *t, const char *msg); |
| 21 | |
| 22 | struct notes_rewrite_cfg { |
| 23 | struct notes_tree **trees; |
| 24 | const char *cmd; |
| 25 | int enabled; |
| 26 | combine_notes_fn combine; |
| 27 | struct string_list *refs; |
| 28 | int refs_from_env; |
| 29 | int mode_from_env; |
| 30 | }; |
| 31 | |
| 32 | struct notes_rewrite_cfg *init_copy_notes_for_rewrite(const char *cmd); |
| 33 | int copy_note_for_rewrite(struct notes_rewrite_cfg *c, |
| 34 | const unsigned char *from_obj, const unsigned char *to_obj); |
| 35 | void finish_copy_notes_for_rewrite(struct notes_rewrite_cfg *c, const char *msg); |
| 36 | |
| 37 | #endif |