Re: [rfc] git: combo-blobs

From: Linus Torvalds
Date: Mon Apr 11 2005 - 15:33:52 EST




On Mon, 11 Apr 2005, Linus Torvalds wrote:
> > bk changes -R
> >
> > bk changes -L
>
> You'd dowload all the sha1 objects (they don't actually do anything to
> _your_ state - they only show the possible other states), and then it's a
> "simple thing" to generate a full tree of your local HEAD commit and
> compare it to a full tree of the remove HEAD commit.

Ok, there's a "rev-tree" program there now to generate these things.

If you control both ends, or have some other means of a "smart"
communications protocol, you don't actually have to download the blobs
themselves. Just download the "rev-tree" from the other side, and you can
generate the differences by comparing your rev-tree against theirs.

(And since they are sorted, the compare is very cheap).

The downside? A revtree can get quite large. My "rev-tree" program allows
you to cache previous state so that you don't have to follow the whole
thing down, though, so it's possible to just send incrementals (since a
"commit" _uniquely_ generates the whole rev-tree, you really can do
reasonably smart things and create "superset revtrees" etc).

So the change difference between two commits is literally

rev-tree [commit-id1] > commit1-revtree
rev-tree [commit-id2] > commit2-revtree
join -t : commit1-revtree commit2-revtree > common-revisions

(this is also how to find the most common parent - you'd look at just the
head revisions - the ones that aren't referred to by other revisions - in
"common-revision", and figure out the best one. I think.)

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/