Linus codes up a patch manager
Posted Apr 9, 2005 1:11 UTC (Sat) by
hppnq (subscriber, #14462)
In reply to:
Linus codes up a patch manager by job
Parent article:
Linus codes up a patch manager
Well, let's give it a try...
Basically git can be used to manage hierarchies of data. It consists of an object database and a directory cache.
The object database consists of trees, blobs and changesets, which are abstract notions of directories, files and some history information regarding changes in the hierarchy.
The objects are all compressed (if you unpack them you get to see the actual hierarchy), and the compressed objects are represented by hashes; SHA1 is probably the algorithm of choice because it produces completely different hashes for objects that differ only very slightly -- it is an extremely reliable way of identifying objects, therefore, as well as for ensuring their integrity.
So, what we've got so far is a clever way of storing and identifying data in a hierarchy (source code, recipes or the formulae for the atomic bomb, whatever you like). Furthermore, through inspection of the hashes, it is possible to see how objects differ, to some extent.
The directory cache is nothing more than that: a single, binary file cache that represents the state of a directory and its contents (a tree object) at some point in time, so it allows for a fast inspection of a tree. But it can also be used to reflect intermediate changes regarding the tree. (Since you can easily compare the cache to the live object.)
Linus has also thrown in a way to implement the "signed-off-by" concept we already know from LKML, by the way.
All this, of course, could in principle be used as a basis for a full-blown SCM tool, which has to add functionality like merging trees and so on; all git does is manage the hierarchy of data (e.g. packing, unpacking, simple comparisons).
(I hope I got at least parts of it right, I'd suggest waiting for the explanation that Jon will hopefully give us. ;-)
(
Log in to post comments)