diff options
author | Thomas Rast <trast@student.ethz.ch> | 2010-03-12 18:04:31 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-03-12 21:55:39 -0800 |
commit | 160baa0d9cbdfcdb6251aa5ede77c59c0d53edfd (patch) | |
tree | 278241bc0737a69c78be1a15655ff05c66261a46 /notes.h | |
parent | b079feed64238558fa24ba8ade892d84628a05ac (diff) | |
download | git-160baa0d9cbdfcdb6251aa5ede77c59c0d53edfd.tar.gz |
notes: implement 'git notes copy --stdin'
This implements a mass-copy command that takes a sequence of lines in
the format
<from-sha1> SP <to-sha1> [ SP <rest> ] LF
on stdin, and copies each <from-sha1>'s notes to the <to-sha1>. The
<rest> 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 <trast@student.ethz.ch>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes.h')
-rw-r--r-- | notes.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -100,6 +100,15 @@ 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() * * Default behaviour of for_each_note() is to traverse every single note object |