From: Jonathan Nieder Date: Sun, 04 Jul 2010 00:35:43 GMT Subject: Re: [WIP/PATCH] Teach fast-import to print the id of each imported commit Message-ID: <20100704003543.GA25858@burratino> In-Reply-To: <1278201760.9701.39.camel@denix> Sam Vilain wrote: > It should be very simple to implement --batch-verify as well, which is > essentially the same thing, just only printing the header and not the > contents. > > How hard do you think it would be to implement a 'rev-parse' command? > Perhaps you can see where this is going... :-) Well, I think I understand what you are saying, but it’s not quite like that. fast-import is already doing a lot of work to keep track of this collection of objects in a pack that is not yet accessible to git because its index has not been written yet. svn-fe needs those objects (well, it at least needs a few blobs when it learns to apply a delta to the latest revision). So what to do? One option is to make fast-import into a library, or copy the code we need into svn-fe. And that would be possible! But it would make svn-fe much more complicated, and there would be this second fast-import interface to maintain. Or svn-fe could keep the full text of all files from the latest revision in a temporary directory. To get blobs for an _older_ revision, it would still need to ask git, but such copy operations are uncommon enough that the time to request a checkpoint and wait for things to settle could be tolerable. The main downside: in a huge repository like ASF’s, that’s a good amount of wasted space. Or one can teach fast-import to supply exactly what we need from it, which is the raw content of some blobs (and perhaps trees) it has written to pack and not indexed yet. Jonathan