{"thread":{"id":"26425","subject":"[PATCH] bundle: Use OFS_DELTA in bundle files","startedAt":"2011-02-06T00:58:53Z","lastAt":"2011-02-07T01:28:06Z","messageCount":2,"participants":["Shawn O. Pearce","Nicolas Pitre"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"160485","messageId":"1296953933-8474-1-git-send-email-spearce@spearce.org","threadId":"26425","inReplyTo":null,"subject":"[PATCH] bundle: Use OFS_DELTA in bundle files","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2011-02-06T00:58:53Z","receivedAt":"2011-02-06T00:58:53Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"git-bundle first appeared in 2e0afafe (\"Add git-bundle\") in Feb 2007,\nand first shipped in Git 1.5.1.\n\nHowever, OFS_DELTA is an even earlier invention, coming about in\neb32d236 (\"introduce delta objects with offset to base\") in Sep 2006,\nand first shipped in Git 1.4.4.5.\n\nOFS_DELTA is smaller, about 3.2%-5% smaller, and is typically faster\nto access than REF_DELTA because the exact location of the delta base\nis available after parsing the object header.  Since all bundle aware\nversions of Git are also OFS_DELTA aware, just make it the default.\n\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n bundle.c |    5 +++--\n 1 files changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/bundle.c b/bundle.c\nindex 65ea26b..f48fd7d 100644\n--- a/bundle.c\n+++ b/bundle.c\n@@ -200,7 +200,7 @@ int create_bundle(struct bundle_header *header, const char *path,\n \tint bundle_fd = -1;\n \tint bundle_to_stdout;\n \tconst char **argv_boundary = xmalloc((argc + 4) * sizeof(const char *));\n-\tconst char **argv_pack = xmalloc(5 * sizeof(const char *));\n+\tconst char **argv_pack = xmalloc(6 * sizeof(const char *));\n \tint i, ref_count = 0;\n \tchar buffer[1024];\n \tstruct rev_info revs;\n@@ -346,7 +346,8 @@ int create_bundle(struct bundle_header *header, const char *path,\n \targv_pack[1] = \"--all-progress-implied\";\n \targv_pack[2] = \"--stdout\";\n \targv_pack[3] = \"--thin\";\n-\targv_pack[4] = NULL;\n+\targv_pack[4] = \"--delta-base-offset\";\n+\targv_pack[5] = NULL;\n \tmemset(&rls, 0, sizeof(rls));\n \trls.argv = argv_pack;\n \trls.in = -1;\n-- \n1.7.4.rc3.268.g2af8b\n"},{"id":"160566","messageId":"alpine.LFD.2.00.1102062027300.12104@xanadu.home","threadId":"26425","inReplyTo":"1296953933-8474-1-git-send-email-spearce@spearce.org","subject":"Re: [PATCH] bundle: Use OFS_DELTA in bundle files","fromName":"Nicolas Pitre","fromEmail":"nico@fluxnic.net","sentAt":"2011-02-07T01:28:06Z","receivedAt":"2011-02-07T01:28:06Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Sat, 5 Feb 2011, Shawn O. Pearce wrote:\n\n> git-bundle first appeared in 2e0afafe (\"Add git-bundle\") in Feb 2007,\n> and first shipped in Git 1.5.1.\n> \n> However, OFS_DELTA is an even earlier invention, coming about in\n> eb32d236 (\"introduce delta objects with offset to base\") in Sep 2006,\n> and first shipped in Git 1.4.4.5.\n> \n> OFS_DELTA is smaller, about 3.2%-5% smaller, and is typically faster\n> to access than REF_DELTA because the exact location of the delta base\n> is available after parsing the object header.  Since all bundle aware\n> versions of Git are also OFS_DELTA aware, just make it the default.\n> \n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n\nAcked-by: Nicolas Pitre <nico@fluxnic.net>\n\n> ---\n>  bundle.c |    5 +++--\n>  1 files changed, 3 insertions(+), 2 deletions(-)\n> \n> diff --git a/bundle.c b/bundle.c\n> index 65ea26b..f48fd7d 100644\n> --- a/bundle.c\n> +++ b/bundle.c\n> @@ -200,7 +200,7 @@ int create_bundle(struct bundle_header *header, const char *path,\n>  \tint bundle_fd = -1;\n>  \tint bundle_to_stdout;\n>  \tconst char **argv_boundary = xmalloc((argc + 4) * sizeof(const char *));\n> -\tconst char **argv_pack = xmalloc(5 * sizeof(const char *));\n> +\tconst char **argv_pack = xmalloc(6 * sizeof(const char *));\n>  \tint i, ref_count = 0;\n>  \tchar buffer[1024];\n>  \tstruct rev_info revs;\n> @@ -346,7 +346,8 @@ int create_bundle(struct bundle_header *header, const char *path,\n>  \targv_pack[1] = \"--all-progress-implied\";\n>  \targv_pack[2] = \"--stdout\";\n>  \targv_pack[3] = \"--thin\";\n> -\targv_pack[4] = NULL;\n> +\targv_pack[4] = \"--delta-base-offset\";\n> +\targv_pack[5] = NULL;\n>  \tmemset(&rls, 0, sizeof(rls));\n>  \trls.argv = argv_pack;\n>  \trls.in = -1;\n> -- \n> 1.7.4.rc3.268.g2af8b\n> \n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> \n"}]}