]> git.ipfire.org Git - thirdparty/git.git/commit - t/t3301-notes.sh
Make "git notes add" more user-friendly when there are existing notes
authorJohan Herland <johan@herland.net>
Wed, 30 Mar 2011 00:02:55 +0000 (02:02 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Mar 2011 20:13:52 +0000 (13:13 -0700)
commit84a7e35eea97388ba5ca458808119650818c2fd2
tree718a121d0a748234fa3c79732733e73fd88185cb
parent537d99033749591245ddd36f7317fd6b8555d803
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>
Documentation/git-notes.txt
builtin/notes.c
t/t3301-notes.sh