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

Re: A generalization of git notes from blobs to trees - git metadata?

From
Jon Seymour <jon.seymour@gmail.com>
Date
Feb 7, 2010, 03:27 UTC
Message-ID
<2cfc40321002061927m522f0c3aj7d727c47a2f0cb22@mail.gmail.com>
In-Reply-To
<201002070236.12711.johan@herland.net>
> I still don't see why this provides anything that isn't already supported by
> either using 'git tag', or by implementing support for notes-as-trees in the
> notes feature.
>

The intent of the metadata facility is to associate derivatives of sha1 with the sha1 itself. If I have calculated a derivative of sha1 in the past, then let me reference that derivative using a metadata path which I can look up knowing only the sha1 of the input and nothing more. Yes, I could create tags of the form ${sha1}/metadata-path for all my derived results but really, this seems an abuse of the tag facility.

Here's another motivating example:

Suppose git-svn wrote the SVN id it was synched with into structured metadata associated with a commit, instead of into the commit message, the equivalent of:

    echo ${svn-id} | git metadata write-blob ${sha1} svn-id

Which means: for the specified sha1, read a blob from stdin and create a metadata item with a metadata path called svn-id

To get it out again, you would write:
    git metadata read-blob ${sha1} svn-id

Which says, for the given object ${sha1}, read the blob from the metadata tree at path svn-id and write its contents to stdout.

This would avoid cluttering the commit message with the svn-id, avoid cluttering the tag space with the info and allow any commit to be tagged in this way.

Admittedly similar function could be achieved a little more clumsily now with appropriate use of GIT_NOTES_REF or with note subtrees, but I share Junio's reservations about trying to generalize notes from blobs to trees, given way notes are currently used by the rest of infrastructure.

jon.
Previous: Johan HerlandNext: Jon Seymour
Message 18 of 19 in “A generalization of git notes from blobs to trees - git metadata?”
  1. Jon SeymourFeb 6, 2010
  2. Johan HerlandFeb 7, 2010
  3. Junio C HamanoFeb 7, 2010
  4. Jeff KingFeb 7, 2010
  5. Jon SeymourFeb 7, 2010
  6. Jakub NarebskiFeb 7, 2010
  7. Jon SeymourFeb 7, 2010
  8. Jon SeymourFeb 7, 2010
  9. Jeff KingFeb 7, 2010
  10. Junio C HamanoFeb 7, 2010
  11. Steven E. HarrisFeb 8, 2010
  12. Jeff KingFeb 10, 2010
  13. Junio C HamanoFeb 10, 2010
  14. Jeff KingFeb 10, 2010
  15. Junio C HamanoFeb 7, 2010
  16. Jeff KingFeb 7, 2010
  17. Johan HerlandFeb 7, 2010
  18. Jon SeymourFeb 7, 2010
  19. Jon SeymourFeb 7, 2010

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.