Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [RFC/PATCH] Make "git notes add" more user-friendly when there are existing notes

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:56

Johan Herland [off-list ref] writes:
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 <redacted>
---

On Tuesday 29 March 2011, Junio C Hamano wrote:
quoted
Michael J Gruber [off-list ref] writes:
quoted
and while at it rename "add" to "edit"
That one I think is older wart that may be harder to change.
Here's one attempt at giving Michael a nicer "git notes add" without
breaking too many existing users. It's not very pretty, but I hope it
gets the job done without inconveniencing current users too much.

After all, current (script) users of "git notes add" that depend on it
failing to overwrite existing notes, should already use -m/-F/-C/-c
instead of the default interactive mode, anyway.
Looks sensible, by addressing the issue gently without going overboard.

Thanks; I like it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help