Re: [PATCH] pack-objects --repack-unpacked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 8 Sep 2007, Junio C Hamano wrote:

> "Shawn O. Pearce" <spearce@xxxxxxxxxxx> writes:
> 
> > Junio C Hamano <gitster@xxxxxxxxx> wrote:
> > ...
> >> +/*
> >> + * Compare the objects in the offset order, in order to emulate the
> >> + * "git-rev-list --objects" output that produced the pack originally.
> >> + */
> >> +static int ofscmp(const void *a_, const void *b_)
> >> +{
> >> +	struct in_pack_object *a = (struct in_pack_object *)a_;
> >> +	struct in_pack_object *b = (struct in_pack_object *)b_;
> >> +
> >> +	if (a->offset < b->offset)
> >> +		return -1;
> >> +	else if (a->offset > b->offset)
> >> +		return 1;
> >> +	else
> >> +		return hashcmp(a->sha1, b->sha1);
> >> +}
> >
> > Really?  It is not possible for two objects to be placed at the
> > same offset within the same packfile and yet have two different
> > SHA-1 values.  The final else condition above is just "return 0".
> 
> This actually was meant to be used to sort object entries from
> multiple packs together.  The update to pack-objects you are
> commenting on deals with one packfile at a time, but I think we
> probably should collect from all packs and then sort (which was
> how merge-pack used this function).

I'm not sure sorting objects from multiple packs together like that is 
going to help deltification.  It is unlikely that related objects (e.g.. 
objects having the same path) will be located at the same offset in 
different packs.


Nicolas
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux