git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 30, 2011, 19:32 UTC
Message-ID
<7vsju4mmjb.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201103300202.55973.johan@herland.net>
Johan Herland <johan@herland.net> writes:
Show 30 quoted lines
> 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>
> ---
>
> On Tuesday 29 March 2011, Junio C Hamano wrote:
>> Michael J Gruber <drmicha@warpmail.net> writes:
>> > 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.
Previous: Michael J Gruber
Message 15 of 15 in “git-notes.txt: clarify -C vs. copy and -F”
  1. git-notes.txt: clarify -C vs. copy and -FMichael J Gruber, Mar 29, 2011
  2. Johan HerlandMar 29, 2011
  3. Junio C HamanoMar 29, 2011
  4. Junio C HamanoMar 29, 2011
  5. Michael J GruberMar 29, 2011
  6. Junio C HamanoMar 29, 2011
  7. Junio C HamanoMar 29, 2011
  8. git-notes.txt: clarify -C vs. copy and -FMichael J Gruber, Aug 25, 2011
  9. Johan HerlandAug 25, 2011
  10. Make "git notes add" more user-friendly when there are existing notesJohan Herland, Mar 30, 2011
  11. Michael J GruberMar 30, 2011
  12. Johan HerlandMar 30, 2011
  13. Lasse MakholmApr 4, 2011
  14. Michael J GruberApr 4, 2011
  15. Junio C HamanoMar 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.