All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bundle: Use OFS_DELTA in bundle files
@ 2011-02-06  0:58 Shawn O. Pearce
  2011-02-07  1:28 ` Nicolas Pitre
  0 siblings, 1 reply; 2+ messages in thread
From: Shawn O. Pearce @ 2011-02-06  0:58 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

git-bundle first appeared in 2e0afafe ("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
eb32d236 ("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>
---
 bundle.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/bundle.c b/bundle.c
index 65ea26b..f48fd7d 100644
--- a/bundle.c
+++ b/bundle.c
@@ -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;
@@ -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;
-- 
1.7.4.rc3.268.g2af8b

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] bundle: Use OFS_DELTA in bundle files
  2011-02-06  0:58 [PATCH] bundle: Use OFS_DELTA in bundle files Shawn O. Pearce
@ 2011-02-07  1:28 ` Nicolas Pitre
  0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Pitre @ 2011-02-07  1:28 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Junio C Hamano, git

On Sat, 5 Feb 2011, Shawn O. Pearce wrote:

> git-bundle first appeared in 2e0afafe ("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
> eb32d236 ("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>

> ---
>  bundle.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/bundle.c b/bundle.c
> index 65ea26b..f48fd7d 100644
> --- a/bundle.c
> +++ b/bundle.c
> @@ -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;
> @@ -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;
> -- 
> 1.7.4.rc3.268.g2af8b
> 
> --
> 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
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-07  1:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-06  0:58 [PATCH] bundle: Use OFS_DELTA in bundle files Shawn O. Pearce
2011-02-07  1:28 ` Nicolas Pitre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.