summaryrefslogtreecommitdiff
path: root/Documentation/git-notes.txt
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-02-13 22:28:32 +0100
committerJunio C Hamano <gitster@pobox.com>2010-02-13 19:36:15 -0800
commit7aa4754e552eff22d70d496dea73a9c7639d66d3 (patch)
treedaad9978c75613bbec158d4dd1ea86c177e291ef /Documentation/git-notes.txt
parentba20f15e0a220705695a1ee19fb28234861b890d (diff)
downloadgit-7aa4754e552eff22d70d496dea73a9c7639d66d3.tar.gz
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>
Diffstat (limited to 'Documentation/git-notes.txt')
-rw-r--r--Documentation/git-notes.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index 8969f6f8fa..94e12b57e4 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -9,6 +9,7 @@ SYNOPSIS
--------
[verse]
'git notes' [list [<object>]]
+'git notes' add [-f] [-F <file> | -m <msg>] [<object>]
'git notes' edit [-F <file> | -m <msg>] [<object>]
'git notes' show [<object>]
'git notes' remove [<object>]
@@ -41,6 +42,11 @@ list::
annotate (in the format "<note object> <annotated object>").
This is the default subcommand if no subcommand is given.
+add::
+ Add notes for a given object (defaults to HEAD). Abort if the
+ object already has notes, abort. (use `-f` to overwrite an
+ existing note).
+
edit::
Edit the notes for a given object (defaults to HEAD).
@@ -57,6 +63,11 @@ prune::
OPTIONS
-------
+-f::
+--force::
+ When adding notes to an object that already has notes,
+ overwrite the existing notes (instead of aborting).
+
-m <msg>::
--message=<msg>::
Use the given note message (instead of prompting).