Subject: Re: git-fast-import

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 7 Feb 2007 17:55:32 -0500

Johannes Schindelin <[email-masked]> wrote:
> On Wed, 7 Feb 2007, Karl Hasselström wrote:
> > In other words, general history rewriting, but fast.
> 
> For this, it would be better to use a different approach: fast-import 
> still hashes all the objects, which would not be necessary when rewriting. 
> I guess that is what cogito's tool is doing.

gfi doesn't require that it rehash blob objects.

If the blobs in question are already available in the repository
gfi is running against (say, from the old branch history) you
can just feed those blob SHA-1s at gfi in its 'M' commands when
making commits.  Yes gfi will need to recompute the tree hashes
from scratch, but those are certainly smaller and faster to create
than blobs.

So you probably could make a faster history rewriter by taking
the output of say `git log --pretty=raw --raw -z`, filter that and
reverse it, and stream it into gfi.  It probably would kick Cogito's
cg-admin-rewritefilter thing in the teeth, as you are forking just
one gfi process rather than a thousand git-commit-tree processes.

And if you are doing more complex pathname translations than just
picking out a subtree, it also completely avoids needing to read and
write index files via update-index, or tree objects by write-tree.

-- 
Shawn.