Re: [PATCH 7/8] git-repack --max-pack-size: split packs as asked by write_object/write_one

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

 



On 4/30/07, Shawn O. Pearce <spearce@xxxxxxxxxxx> wrote:
Dana How <danahow@xxxxxxxxx> wrote:
> Rewrite write_pack_file() to break to a new packfile
> whenever write_object/write_one request it,  and
> correct the header's object count in the previous packfile.
> Change write_index_file() to write an index
> for just the objects in the most recent packfile.
...
> diff --git a/builtin-pack-objects.c b/builtin-pack-objects.c
...
> +             hdr.hdr_signature = htonl(PACK_SIGNATURE);
> +             hdr.hdr_version = htonl(PACK_VERSION);
> +             hdr.hdr_entries = htonl(nr_result);

What about keeping track of how many objects in nr_result that
have been written already in the prior iteration of this do{}
while loop and using that to set hdr_entries?  This way if you are
splitting into multiple packfiles the last packfile won't need to
do a header/footer fixup.
Cool --
I had the same thought (late),
but figured I would address it in a follow-on.
I was thinking of adding nr_left, which would be initialized
from nr_result, and have nr_written repeatedly subtracted.
nr_result in your quote would change to nr_left
(also later, where we decide whether or not to fix up the header).

Thanks,
--
Dana L. How  danahow@xxxxxxxxx  +1 650 804 5991 cell
-
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]