From 7aa4754e552eff22d70d496dea73a9c7639d66d3 Mon Sep 17 00:00:00 2001 From: Johan Herland Date: Sat, 13 Feb 2010 22:28:32 +0100 Subject: 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 Improved-by: Junio C Hamano Signed-off-by: Johan Herland Signed-off-by: Junio C Hamano --- Documentation/git-notes.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Documentation') 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 []] +'git notes' add [-f] [-F | -m ] [] 'git notes' edit [-F | -m ] [] 'git notes' show [] 'git notes' remove [] @@ -41,6 +42,11 @@ list:: annotate (in the format " "). 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 :: --message=:: Use the given note message (instead of prompting). -- cgit v1.2.3