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

Re: full kernel history, in patchset format

From
Linus Torvalds <torvalds@osdl.org>
Date
Apr 16, 2005, 18:44 UTC
Message-ID
<Pine.LNX.4.58.0504161135480.7211@ppc970.osdl.org>
In-Reply-To
<1113679421.28612.16.camel@tglx.tec.linutronix.de>
On Sat, 16 Apr 2005, Thomas Gleixner wrote:
Show 7 quoted lines
> 
> One remark on the tree blob storage format. 
> The binary storage of the sha1sum of the refered object is a PITA for
> scripting. 
> Converting the ASCII -> binary for the sha1sum comparision should not
> take much longer than the binary -> ASCII conversion for the file
> reference. Can this be changed ?

I'd really rather not. Why don't you just use "ls-tree" for scripting? That's why it exists in the first place.

It might make sense to have some simple selection capabilities built into ls-tree (ie "ls-tree --match drivers/char/ -z <treesha1>" to get just a subtree out), but that depends entirely on how you end up using it.

The fact is, there should _never_ any reason to look at the objects themselves directly. "cat-file" is a debugging aid, it shouldn't be scripted (with the possible exception of "cat-file blob xxxx" to just extract the blob contents, since that object doesn't have any internal structure).

That level of abstraction ("we never look directly at the objects") is what allows us to change the object structure later. For example, we already changed the "commit" date thing once, and the tree object has obviously evolved a bit, and if we ever change the hash, the objects will change too, but if you always just script them using nice helper tools, you won't ever need to _care_. And that's how it should be.

If there's a tool missing, holler. THAT is the part I've been trying to write: all the plumbing so that you _can_ script the thing sanely, and not worry about how objects are created and worked with.

For example, that "index" file format likely _will_ change. I ended up doing the new "stage" flags in a way that kept the index file compatible with old ones, but I did that mainly because it also happened to be the easiest way to enforce the rule I wanted to enforce (ie the "stage" really _is_ a part of the filename from a "compare filenames" standpoint, in order to make sure that the stages are always ordered).

So if the index file change hadn't had that property, I'd have just said "I'll change the format", and anybody who tried to parse the index file would have been _broken_.

		Linus
Previous: Thomas GleixnerNext: Thomas Gleixner
Message 22 of 42 in “full kernel history, in patchset format”
  1. Ingo MolnarApr 16, 2005
  2. Ingo MolnarApr 16, 2005
  3. David MansfieldApr 16, 2005
  4. Ingo MolnarApr 16, 2005
  5. Francois RomieuApr 16, 2005
  6. Linus TorvaldsApr 16, 2005
  7. Petr BaudisApr 16, 2005
  8. Christopher LiApr 16, 2005
  9. Junio C HamanoApr 16, 2005
  10. Mike TahtApr 16, 2005
  11. Junio C HamanoApr 16, 2005
  12. Christopher LiApr 16, 2005
  13. Junio C HamanoApr 16, 2005
  14. Mike TahtApr 16, 2005
  15. Daniel BarkalowApr 16, 2005
  16. Junio C HamanoApr 16, 2005
  17. Jan-Benedict GlawApr 16, 2005
  18. Thomas GleixnerApr 16, 2005
  19. Petr BaudisApr 16, 2005
  20. Petr BaudisApr 16, 2005
  21. Thomas GleixnerApr 16, 2005
  22. Linus TorvaldsApr 16, 2005
  23. Thomas GleixnerApr 16, 2005
  24. Petr BaudisApr 16, 2005
  25. Junio C HamanoApr 16, 2005
  26. Linus TorvaldsApr 16, 2005
  27. Thomas GleixnerApr 16, 2005
  28. David LangApr 16, 2005
  29. Ingo MolnarApr 16, 2005
  30. David WoodhouseApr 17, 2005
  31. Petr BaudisApr 17, 2005
  32. David WoodhouseApr 18, 2005
  33. Petr BaudisApr 18, 2005
  34. David WoodhouseApr 18, 2005
  35. Petr BaudisApr 18, 2005
  36. David WoodhouseApr 18, 2005
  37. Petr BaudisApr 18, 2005
  38. Linus TorvaldsApr 18, 2005
  39. David WoodhouseApr 18, 2005
  40. Catalin MarinasApr 18, 2005
  41. David MansfieldApr 18, 2005
  42. Catalin MarinasApr 19, 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.