aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/git-notes.txt
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2011-03-30 02:02:55 +0200
committerJunio C Hamano <gitster@pobox.com>2011-03-30 13:13:52 -0700
commit84a7e35eea97388ba5ca458808119650818c2fd2 (patch)
tree718a121d0a748234fa3c79732733e73fd88185cb /Documentation/git-notes.txt
parent537d99033749591245ddd36f7317fd6b8555d803 (diff)
downloadgit-84a7e35eea97388ba5ca458808119650818c2fd2.tar.gz
Make "git notes add" more user-friendly when there are existing notes
Currently, "notes add" (without -f/--force) will abort when the given object already has existing notes. This makes sense for the modes of "git notes add" that would necessarily overwrite the old message (when using the -m/-F/-C/-c options). However, when no options are given (meaning the notes are created from scratch in the editor) it is not very user-friendly to abort on existing notes, and forcing the user to run "git notes edit". Instead, it is better to simply "redirect" to "git notes edit" automatically, i.e. open the existing notes in the editor and let the user edit them. This patch does just that. This changes the behavior of "git notes add" without options when notes already exist for the given object, but I doubt that many users really depend on the previous failure from "git notes add" in this case. 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.txt7
1 files changed, 5 insertions, 2 deletions
diff --git a/Documentation/git-notes.txt b/Documentation/git-notes.txt
index 296f314eae..913ecd8c43 100644
--- a/Documentation/git-notes.txt
+++ b/Documentation/git-notes.txt
@@ -57,8 +57,11 @@ list::
add::
Add notes for a given object (defaults to HEAD). Abort if the
- object already has notes (use `-f` to overwrite an
- existing note).
+ object already has notes (use `-f` to overwrite existing notes).
+ However, if you're using `add` interactively (using an editor
+ to supply the notes contents), then - instead of aborting -
+ the existing notes will be opened in the editor (like the `edit`
+ subcommand).
copy::
Copy the notes for the first object onto the second object.