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

Re: [1/5] Parsing code in revision.h

From
Petr Baudis <pasky@ucw.cz>
Date
Apr 17, 2005, 18:30 UTC
Message-ID
<20050417183002.GE1461@pasky.ji.cz>
In-Reply-To
<Pine.LNX.4.58.0504171114020.7211@ppc970.osdl.org>

Dear diary, on Sun, Apr 17, 2005 at 08:18:47PM CEST, I got a letter where Linus Torvalds <torvalds@osdl.org> told me that...

Show 20 quoted lines
> 
> 
> On Sun, 17 Apr 2005, Daniel Barkalow wrote:
> >
> > --- 45f926575d2c44072bfcf2317dbf3f0fbb513a4e/revision.h  (mode:100644 sha1:28d0de3261a61f68e4e0948a25a416a515cd2e83)
> > +++ 37a0b01b85c2999243674d48bfc71cdba0e5518e/revision.h  (mode:100644 sha1:523bde6e14e18bb0ecbded8f83ad4df93fc467ab)
> > @@ -24,6 +24,7 @@
> >  	unsigned int flags;
> >  	unsigned char sha1[20];
> >  	unsigned long date;
> > +	unsigned char tree[20];
> >  	struct parent *parent;
> >  };
> >  
> 
> I think this is really wrong.
> 
> The whole point of "revision.h" is that it's a generic framework for 
> keeping track of relationships between different objects. And those 
> objects are in no way just "commit" objects.

Someone started the avalanche by adding date to the structure. Of course, date is smaller, but it leads people (including me) out of the way.

Perhaps struct commit which will have struct revision (ugh - what about rather struct object?) as a member?

> For example, fsck uses this "struct revision" to create a full free of 
> _all_ the object dependencies, which means that a "struct revision" can be 
> any object at all - it's not in any way limited to commit objects, and 
> there is no "tree" object that is associated with these things at all.
That's some really bad naming then.
Show 8 quoted lines
> Besides, why do you want the tree? There's really nothing you can do with 
> the tree to a first approximation - you need to _first_ do the 
> reachability analysis entirely on the commit dependencies, and then when 
> you've selected a set of commits, you can just output those.
> 
> Later phases will indeed look up what the tree is, but that's only after
> you've decided on the commit object. There's no point in looking up (or
> even trying to just remember) _all_ the tree objects.

The goal was to have a commit record parser which would spit out this structure containing all the relevant info, but I can agree that wasting memory with it makes no sense. Perhaps it could take a possibly-NULL buffer pointer where it would drop the tree ID, Daniel?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Linus TorvaldsNext: Linus Torvalds
Message 6 of 37 in “[0/5] Patch set for various things”
  1. Daniel BarkalowApr 17, 2005
  2. 1/5 Parsing code in revision.hDaniel Barkalow, Apr 17, 2005
  3. Petr BaudisApr 17, 2005
  4. Daniel BarkalowApr 17, 2005
  5. Linus TorvaldsApr 17, 2005
  6. Petr BaudisApr 17, 2005
  7. Linus TorvaldsApr 17, 2005
  8. Daniel BarkalowApr 17, 2005
  9. Linus TorvaldsApr 17, 2005
  10. Daniel BarkalowApr 17, 2005
  11. 2/5 Add merge-baseDaniel Barkalow, Apr 17, 2005
  12. Petr BaudisApr 17, 2005
  13. Daniel BarkalowApr 17, 2005
  14. 1/5 Add merge-baseDaniel Barkalow, Apr 17, 2005
  15. Petr BaudisApr 17, 2005
  16. Daniel BarkalowApr 17, 2005
  17. 3/5 Add http-pullDaniel Barkalow, Apr 17, 2005
  18. Petr BaudisApr 17, 2005
  19. Daniel BarkalowApr 17, 2005
  20. Petr BaudisApr 17, 2005
  21. Daniel BarkalowApr 17, 2005
  22. Petr BaudisApr 17, 2005
  23. Brad RobertsApr 21, 2005
  24. Daniel BarkalowApr 21, 2005
  25. tony.luck@intel.comApr 21, 2005
  26. Daniel BarkalowApr 22, 2005
  27. Petr BaudisApr 22, 2005
  28. Daniel BarkalowApr 22, 2005
  29. Petr BaudisApr 22, 2005
  30. Daniel BarkalowApr 22, 2005
  31. Martin SchlemmerApr 22, 2005
  32. 1/5 Add http-pullDaniel Barkalow, Apr 17, 2005
  33. 4/5 Add option for hardlinkable cache of extracted blobsDaniel Barkalow, Apr 17, 2005
  34. Petr BaudisApr 17, 2005
  35. Daniel BarkalowApr 17, 2005
  36. Paul JacksonApr 17, 2005
  37. 5/5 Add commit-id to versionDaniel Barkalow, Apr 17, 2005

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.