Skip to content

Commit

Permalink
bundle: Use OFS_DELTA in bundle files
Browse files Browse the repository at this point in the history
git-bundle first appeared in 2e0afaf ("Add git-bundle") in Feb 2007,
and first shipped in Git 1.5.1.

However, OFS_DELTA is an even earlier invention, coming about in
eb32d23 ("introduce delta objects with offset to base") in Sep 2006,
and first shipped in Git 1.4.4.5.

OFS_DELTA is smaller, about 3.2%-5% smaller, and is typically faster
to access than REF_DELTA because the exact location of the delta base
is available after parsing the object header.  Since all bundle aware
versions of Git are also OFS_DELTA aware, just make it the default.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Shawn O. Pearce authored and Junio C Hamano committed Feb 7, 2011
1 parent 597a630 commit 787d2a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bundle.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int create_bundle(struct bundle_header *header, const char *path,
int bundle_fd = -1;
int bundle_to_stdout;
const char **argv_boundary = xmalloc((argc + 4) * sizeof(const char *));
const char **argv_pack = xmalloc(5 * sizeof(const char *));
const char **argv_pack = xmalloc(6 * sizeof(const char *));
int i, ref_count = 0;
char buffer[1024];
struct rev_info revs;
Expand Down Expand Up @@ -346,7 +346,8 @@ int create_bundle(struct bundle_header *header, const char *path,
argv_pack[1] = "--all-progress-implied";
argv_pack[2] = "--stdout";
argv_pack[3] = "--thin";
argv_pack[4] = NULL;
argv_pack[4] = "--delta-base-offset";
argv_pack[5] = NULL;
memset(&rls, 0, sizeof(rls));
rls.argv = argv_pack;
rls.in = -1;
Expand Down

0 comments on commit 787d2a7

Please sign in to comment.