On Thu, 6 Sep 2007, Junio C Hamano wrote:I wonder if this is the best way to go. In the context of a really fast repack happening automatically after (or during) user interactive operations, the above seems a bit heavyweight and slow to me. I would have concatenated all packs provided on the command line into a single one, simply by reading data from existing packs and writing it back without any processing at all. The offset for OBJ_OFS_DELTA is relative so a simple concatenation will just work. Then the index for that pack can be created just as easily by reading existing pack index files and storing the data into an array of struct pack_idx_entry, adding the appropriate offset to object offsets, then call write_idx_file(). All data is read once and written once making it no more costly than a simple file copy. On the flip side it wouldn't get rid of duplicated objects (I don't know if that matters i.e. if something might break with the same object twice in a pack). You might want to move the new pack before removing the old ones though. It is, and IMHO not worth it. If you do it separately from the usual pack-objects process you'll perform extra IO and decompression when walking tree objects just to reconstruct those paths, becoming really slow by the context definition I provided above. If you really want to do it then the best way might simply to reverse your find result above, in order to use pack-objects as if the larger packs, i.e. the ones that you don't want to merge, simply had an associated .keep file. In fact, since we want to _also_ perform a repack of loose objects in the context of automatic repacking, I wonder why we wouldn't use that --unpacked= argument to also repack smallish packs at the same time in only one pack-objects pass. Or maybe I'm missing something? Nicolas - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Bart Van Assche | Re: Integration of SCST in the mainstream Linux kernel |
| Greg KH | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Andrew Morton | Re: -mm merge plans for 2.6.23 -- sys_fallocate |
git: | |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| David Miller | [GIT]: Networking |
| Radu Rendec | htb parallelism on multi-core platforms |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
