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

Re: Bug/request: the empty string should be a valid git note

From
Kyle J. McKay <mackyle@gmail.com>
Date
Sep 21, 2014, 23:32 UTC
Message-ID
<1A2394C0-50A4-40F4-B0B9-B2EC38109083@gmail.com>
In-Reply-To
<CALKQrgd9BPUTrgZvFCj_fznRG6RmfiGzW68XF++yykMguypTig@mail.gmail.com>
On Sep 20, 2014, at 18:44, Johan Herland wrote:
Show 10 quoted lines
> At least, we should fix
>
>    git notes add -C e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
>
> Whether we should also change
>
>    git notes add -m ''
>
> to create an empty note, or leave it as-is, (i.e. similar in spirit to
> "git commit -m ''"), I'll leave up to further discussion.
The help for git commit has this:
   --allow-empty-message
     Like --allow-empty this command is primarily for use by
     foreign SCM interface scripts. It allows you to create
     a commit with an empty commit message without using
     plumbing commands like git-commit-tree(1).
Why not add the same/similar option to git notes add?
So this:
   git notes add --allow-empty-message -m ''

creates an empty note. (Perhaps --allow-empty-note should be an alias?)

With your patch to allow -C e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 there's already support for it, it just needs the option parsing added. :)

--Kyle
Previous: Johan HerlandNext: Junio C Hamano
Message 7 of 8 in “Bug/request: the empty string should be a valid git note”
  1. James H. FisherSep 20, 2014
  2. James H. FisherSep 20, 2014
  3. Johan HerlandSep 21, 2014
  4. notes: Allow adding empty notes with -CJohan Herland, Sep 21, 2014
  5. Torsten BögershausenSep 21, 2014
  6. Johan HerlandSep 21, 2014
  7. Kyle J. McKaySep 21, 2014
  8. Junio C HamanoSep 22, 2014

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.