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

Re: [PATCH 00/15] git-note: A mechanisim for providing free-form after-the-fact annotations on commits

From
Johan Herland <johan@herland.net>
Date
May 28, 2007, 10:54 UTC
Message-ID
<200705281254.23297.johan@herland.net>
In-Reply-To
<alpine.LFD.0.98.0705272131370.26602@woody.linux-foundation.org>
On Monday 28 May 2007, Linus Torvalds wrote:
Show 14 quoted lines
> 
> On Sun, 27 May 2007, Johan Herland wrote:
> > 
> > I've been working on combining tag objects and --decorate into a useful
> > proof-of-concept that provides the after-the-fact commit annotations I
> > requested above, and here's the result:
> 
> Ok, looks fine to me. I do have a few questions:
>  - why don't you just let people name their notes, the same way we name 
>    tags (and then actually using it as the note name?)
> 
>    Putting them in the refs/notes/ filesystem by their SHA1 seems a bit 
>    wasteful, and it would seem that it could be quite nice to name the 
>    notes some way?

Well, when I first designed them, I thought of notes more as an extension to the commit message than as a special case of tags. Therefore naming them didn't seem natural at that point. But now that it all seems to blend together (cf. Junio's answer), I'm not opposed to putting names on notes at all. But I don't want to make naming mandatory. It should still be possible to add a note like "Fixes bug #12345" in a jiffy, without having to think up a note name as well (or having a badly thought-up name pollute some namespace).

So I guess we end up with two kinds of objects/entities:
1. tags, with mandatory naming and optional comment/message
2. notes, with optional naming and mandatory comment/message

To some degree we can say that the name is the ref, and the comment/message is the object. We therefore get:

1. tags, with mandatory ref and optional tag object (we have this today)
2. notes, with optional ref and mandatory object

Today, a note needs its ref in order to stay alive, but this is purely a (badly designed) technical measure. When we get the proper reverse mapping done (as discussed in Junio's answer), notes will stop polluting refs/ and we can instead allow naming of notes by adding simple (tag-type) refs to note objects.

Also, as mentioned by Junio, we want to do the reverse mapping for regular tags as well.

At this point, there's no real difference between tags and notes (some would say there never were a difference), and we can stop caring about whether a note is a note or a tag, etc, at least in the plumbing.

We may still want to enforce a difference in the procelain, though. When presenting tags/notes (e.g. with --decorate), users might be interested in classifying and filtering their tags/notes in different categories. Categories might be ("note", "tag"), or we can make it user-extensible, like Junio's "keyword" idea). Either way, we'll have to make room for this classification in the tag object by adding another header ("tagtype", "keyword", whatever...).

And while we're on the subject of changing the tag object, I'd like for the "tag" header (the one holding the tag name) to become optional. When doing my ref <-> name trick above, I conveniently forgot this little bugger. Basically the only reason for this one to exist is to include the name of the tag in the data passed to gpg for signing. This is of course necesssary in order to make renaming a signed tag impossible. (Allowing renaming would make it possible to replace it with a malicious tag with the original name.) Therefore the "tag" header must be mandatory for signed tags. But for all other tags (including notes) this header is pretty much useless.

>  - This will probably scale horribly badly if you have tens of thousands 
>    of notes, even when they are packed. Do we care?

I can't see why the current implementation would scale any worse than an equivalent number of (annotated/signed) tags. But then again, the tag system might not have been designed with tens of thousands of tag objects in mind. :)

> Other than that, it looks straightforward and sane.
Thanks for the feedback
Have fun!
...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Previous: Linus TorvaldsNext: Linus Torvalds
Message 30 of 53 in “[RFC] Second parent for reverts”
  1. Daniel BarkalowMay 9, 2007
  2. Johannes SchindelinMay 9, 2007
  3. Shawn O. PearceMay 9, 2007
  4. Johan HerlandMay 9, 2007
  5. Junio C HamanoMay 9, 2007
  6. Linus TorvaldsMay 9, 2007
  7. Linus TorvaldsMay 10, 2007
  8. Johan HerlandMay 10, 2007
  9. Linus TorvaldsMay 10, 2007
  10. 00/15 git-note: A mechanisim for providing free-form after-the-fact annotations on commitsJohan Herland, May 27, 2007
  11. 01/15 git-note: Add git-note command for adding/listing/deleting git notesJohan Herland, May 27, 2007
  12. 02/15 git-note: (Documentation) Add git-note manual pageJohan Herland, May 27, 2007
  13. 03/15 git-note: (Administrivia) Add git-note to Makefile, .gitignore, etc.Johan Herland, May 27, 2007
  14. 04/15 git-note: (Plumbing) Add plumbing-level support for git notesJohan Herland, May 27, 2007
  15. 05/15 git-note: (Plumbing) Add support for git notes to git-rev-parse and git-show-refJohan Herland, May 27, 2007
  16. 06/15 git-note: (Documentation) Explain the new '--notes' option to git-rev-parse and git-show-refJohan Herland, May 27, 2007
  17. 07/15 git-note: (Almost plumbing) Add support for git notes to git-pack-refs and git-fsckJohan Herland, May 27, 2007
  18. 08/15 git-note: (Decorations) Add note decorations to "git-{log,show,whatchanged} --decorate"Johan Herland, May 27, 2007
  19. 09/15 git-note: (Documentation) Explain new behaviour of --decorate in git-{log,show,whatchanged}Johan Herland, May 27, 2007
  20. 10/15 git-note: (Transfer) Teach git-clone how to clone notesJohan Herland, May 27, 2007
  21. 11/15 git-note: (Transfer) Teach git-fetch to auto-follow notesJohan Herland, May 27, 2007
  22. 12/15 git-note: (Transfer) Teach git-push to push notes when --all or --notes is givenJohan Herland, May 27, 2007
  23. 13/15 git-note: (Documentation) Explain the new --notes option to git-pushJohan Herland, May 27, 2007
  24. 14/15 git-note: (Tests) Add tests for git-note and associated functionalityJohan Herland, May 27, 2007
  25. 15/15 git-note: Add display of notes to gitkJohan Herland, May 27, 2007
  26. Junio C HamanoMay 27, 2007
  27. Johan HerlandMay 28, 2007
  28. Jakub NarebskiMay 28, 2007
  29. Linus TorvaldsMay 28, 2007
  30. Johan HerlandMay 28, 2007
  31. Linus TorvaldsMay 28, 2007
  32. Johan HerlandMay 28, 2007
  33. Linus TorvaldsMay 28, 2007
  34. Johan HerlandMay 28, 2007
  35. Junio C HamanoMay 28, 2007
  36. Shawn O. PearceMay 28, 2007
  37. Johannes SchindelinMay 28, 2007
  38. Linus TorvaldsMay 29, 2007
  39. Shawn O. PearceMay 29, 2007
  40. Jakub NarebskiMay 29, 2007
  41. Andy ParkinsMay 29, 2007
  42. Johannes SchindelinMay 29, 2007
  43. Johan HerlandMay 29, 2007
  44. Jeff KingMay 29, 2007
  45. Johan HerlandMay 29, 2007
  46. Junio C HamanoMay 28, 2007
  47. Shawn O. PearceMay 28, 2007
  48. Add fsck_verify_ref_to_tag_object() to verify that refname matches name stored in tag objectJohan Herland, May 28, 2007
  49. Michael S. TsirkinMay 28, 2007
  50. Michael S. TsirkinMay 28, 2007
  51. Johan HerlandMay 28, 2007
  52. Martin LanghoffMay 10, 2007
  53. Junio C HamanoMay 10, 2007

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.