Code

builtin-notes: Add "copy" subcommand for copying notes between objects
authorJohan Herland <johan@herland.net>
Sat, 13 Feb 2010 21:28:38 +0000 (22:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 14 Feb 2010 03:36:17 +0000 (19:36 -0800)
commite73bbd96c6e9ce11a101dac03402d0f718a1bd23
treeb4922667d15dbc5bca2d4a3b0898cb30b7bdedd5
parent5848769f9de68cfb0735710c6c4d2f08aa53f317
builtin-notes: Add "copy" subcommand for copying notes between objects

This is useful for keeping notes to objects that are being rewritten by e.g.
'git commit --amend', 'git rebase', or 'git cherry-pick'.

"git notes copy <from> <to>" is in practice equivalent to
"git notes add -C $(git notes list <from>) <to>", although it is somewhat
more convenient for regular users.

"git notes copy" takes the same -f option as "git add", to overwrite existing
notes at the target (instead of aborting with an error message).

If the <from>-object has no notes, "git notes copy" will abort with an error
message.

The patch includes tests verifying correct behaviour of the new subcommand.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-notes.txt
builtin-notes.c
t/t3301-notes.sh