]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/notes.c
builtin-notes: Add "add" subcommand for adding notes to objects
authorJohan Herland <johan@herland.net>
Sat, 13 Feb 2010 21:28:32 +0000 (22:28 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 14 Feb 2010 03:36:15 +0000 (19:36 -0800)
commit7aa4754e552eff22d70d496dea73a9c7639d66d3
treedaad9978c75613bbec158d4dd1ea86c177e291ef
parentba20f15e0a220705695a1ee19fb28234861b890d
builtin-notes: Add "add" subcommand for adding notes to objects

"git notes add" is identical to "git notes edit" except that instead of
editing existing notes for a given object, you can only add notes to an
object that currently has none. If "git notes add" finds existing notes
for the given object, the addition is aborted. However, if the new
-f/--force option is used, "git notes add" will _overwrite_ the existing
notes with the new notes contents.

If there is no existing notes for the given object. "git notes add" is
identical to "git notes edit" (i.e. it adds a new note).

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

Suggested-by: Joey Hess <joey@kitenet.net>
Improved-by: Junio C Hamano <gitster@pobox.com>
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