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

Re: [PATCH 0/4] git-notes ui fixes regarding non-blobs notes

From
Jeff King <peff@peff.net>
Date
May 10, 2012, 14:29 UTC
Message-ID
<20120510142920.GA14711@sigill.intra.peff.net>
In-Reply-To
<1336658701-9004-1-git-send-email-pclouds@gmail.com>
On Thu, May 10, 2012 at 09:04:57PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 5 quoted lines
> Thanks Jeff and Junio for all the comments. This is basically what you
> (and I) agree in v1's thread. The first patch is a new one, to avoid
> git-notes from converting everything to blobs. I don't restrict the
> "show" case either because git-notes uses "git show", which is
> capable of displaying all kinds of objects.
Nice, this is much better than the previous round.

I was surprised by the "git show" thing you mentioned, because I checked before that "git notes add -C HEAD^{tree}; git notes show" generated garbage. But the problem is that "-C $tree" was more broken than we realized. It actually copied the tree contents into a blob object, giving it a new sha1:

  $ git rev-parse HEAD^{tree}
  f799843170cdddbbdfec446e934bbccf94e0d2a7
  $ git notes add -C HEAD^{tree}
  $ git notes list HEAD
  587521811b7a5b84ed7cb48d11f9321ddcefd337

So it really was totally useless, and nobody could possibly have been using it to store a real tree object, experimental or otherwise. But I still like these patches better than just disallowing it, because they allow people to experiment with the idea.

It's a little odd that we rewrite the object in the "-C" case at all; we should never even need to open the object. I guess it is just to make the code paths between "-c" and "-C" simpler.

-Peff
Previous: Junio C HamanoNext: Nguyễn Thái Ngọc Duy
Message 20 of 29 in “notes: do not accept non-blobs as new notes”
  1. notes: do not accept non-blobs as new notesNguyễn Thái Ngọc Duy, May 8, 2012
  2. Jeff KingMay 8, 2012
  3. Junio C HamanoMay 8, 2012
  4. Nguyen Thai Ngoc DuyMay 9, 2012
  5. Jeff KingMay 9, 2012
  6. Junio C HamanoMay 9, 2012
  7. Jeff KingMay 9, 2012
  8. 0/4 git-notes ui fixes regarding non-blobs notesNguyễn Thái Ngọc Duy, May 10, 2012
  9. 1/4 notes: preserve object type given by "add -C"Nguyễn Thái Ngọc Duy, May 10, 2012
  10. 2/4 notes: "add -c" refuses to open an editor with non-blobsNguyễn Thái Ngọc Duy, May 10, 2012
  11. Johannes SixtMay 10, 2012
  12. Nguyen Thai Ngoc DuyMay 11, 2012
  13. 3/4 notes: refuse to edit non-blobsNguyễn Thái Ngọc Duy, May 10, 2012
  14. 4/4 notes: refuse to append to non-blob notesNguyễn Thái Ngọc Duy, May 10, 2012
  15. 4/4 notes: only append a blob to a blobNguyễn Thái Ngọc Duy, May 10, 2012
  16. Jeff KingMay 10, 2012
  17. Nguyen Thai Ngoc DuyMay 10, 2012
  18. Jeff KingMay 10, 2012
  19. Junio C HamanoMay 11, 2012
  20. Jeff KingMay 10, 2012
  21. 0/4 non-blob notes fixesNguyễn Thái Ngọc Duy, May 11, 2012
  22. 1/4 notes: preserve object type given by "add -C"Nguyễn Thái Ngọc Duy, May 11, 2012
  23. Junio C HamanoMay 11, 2012
  24. Nguyen Thai Ngoc DuyMay 12, 2012
  25. Junio C HamanoMay 12, 2012
  26. Nguyen Thai Ngoc DuyMay 12, 2012
  27. 2/4 notes: "add -c" refuses to open an editor with non-blobsNguyễn Thái Ngọc Duy, May 11, 2012
  28. 3/4 notes: refuse to edit non-blobsNguyễn Thái Ngọc Duy, May 11, 2012
  29. 4/4 notes: only allow to append a blob to a blobNguyễn Thái Ngọc Duy, May 11, 2012

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.