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

Re: Storing additional information in commit headers

From
MKmartin f krafft <madduck@madduck.net>
Date
Aug 1, 2011, 18:28 UTC
Message-ID
<20110801182845.GA4303@fishbowl.rw.madduck.net>
In-Reply-To
<20110801182015.GA3100@fishbowl.rw.madduck.net>
also sprach martin f krafft <madduck@madduck.net> [2011.08.01.2020 +0200]:
Show 5 quoted lines
> Hence, if I were to store additional information in the commit
> object headers, this information would by design be correct,
> immutable, and non-redundant. I am going to reply to my own mail
> with some implementation details to feed the curious, with the hope
> to keep this debate focused.

For lack of a better idea (cf. [0]), I am currently toying with the following approach:

Possibly in addition to the orphan parent pointer to a commit object suggested in [0], and in order to provide a clear means to identify said orphan parent pointer (holding additional information), I am considering storing this orphan parent commit's ref in the main commit, using a header like x-topgit-top-base [1].

0. http://permalink.gmane.org/gmane.comp.version-control.git/178349
1. The use of the x- prefix is obviously intentional to suggest that
   this is a free-form, non-standard extension.

Whenever the extra data need changing, a new x-topgit-top-base ref is added to HEAD.

Now, given a commitish, I simply have to walk back in time until I find a commit object with such a header, and I have the most recent metadata at my fingertips.

Instead of a ref to the orphan parent commit (which visibily pollutes the history), I could also just store the information right there.

This is arguably hackish, but unless I find a better way, it's the best I've come up with thus far.

And of course, this could go into the commit message body text, but it being an implementation detail, that's really not the right place for it.

Thanks for your consideration,
-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
"there are two major products that come out of berkeley: lsd and unix."
 one caused me an addiction
                                                             -- fyodor
 
spamtraps: madduck.bogus@madduck.net
Previous: martin f krafftNext: Martin Langhoff
Message 6 of 23 in “Storing additional information in commit headers”
  1. martin f krafftAug 1, 2011
  2. Sverre RabbelierAug 1, 2011
  3. martin f krafftAug 1, 2011
  4. Clemens BuchacherAug 1, 2011
  5. martin f krafftAug 1, 2011
  6. martin f krafftAug 1, 2011
  7. Martin LanghoffAug 1, 2011
  8. martin f krafftAug 1, 2011
  9. Jeff KingAug 1, 2011
  10. martin f krafftAug 1, 2011
  11. Jeff KingAug 2, 2011
  12. martin f krafftAug 2, 2011
  13. working prototype of orphan parent commits as datastores (was: Storing additional information in commit headers)martin f krafft, Aug 2, 2011
  14. Jeff KingAug 2, 2011
  15. martin f krafftAug 2, 2011
  16. martin f krafftAug 2, 2011
  17. Jeff KingAug 2, 2011
  18. martin f krafftAug 2, 2011
  19. per-ref data storage (was: Storing additional information in commit headers)martin f krafft, Aug 2, 2011
  20. martin f krafftAug 2, 2011
  21. Jeff KingAug 4, 2011
  22. Jeff KingAug 4, 2011
  23. Michael HaggertyAug 2, 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.