From 160baa0d9cbdfcdb6251aa5ede77c59c0d53edfd Mon Sep 17 00:00:00 2001 From: Thomas Rast Date: Fri, 12 Mar 2010 18:04:31 +0100 Subject: notes: implement 'git notes copy --stdin' This implements a mass-copy command that takes a sequence of lines in the format SP [ SP ] LF on stdin, and copies each 's notes to the . The is ignored. The intent, of course, is that this can read the same input that the 'post-rewrite' hook gets. The copy_note() function is exposed for everyone's and in particular the next commit's use. Signed-off-by: Thomas Rast Acked-by: Johan Herland Signed-off-by: Junio C Hamano --- notes.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'notes.h') diff --git a/notes.h b/notes.h index 2cc07409d..b7fafb448 100644 --- a/notes.h +++ b/notes.h @@ -99,6 +99,15 @@ void remove_note(struct notes_tree *t, const unsigned char *object_sha1); const unsigned char *get_note(struct notes_tree *t, const unsigned char *object_sha1); +/* + * Copy a note from one object to another in the given notes_tree. + * + * Fails if the to_obj already has a note unless 'force' is true. + */ +int copy_note(struct notes_tree *t, + const unsigned char *from_obj, const unsigned char *to_obj, + int force, combine_notes_fn combine_fn); + /* * Flags controlling behaviour of for_each_note() * -- cgit v1.2.1