{"thread":{"id":"5912","subject":"[PATCH 1/2] pack-objects: document --delta-base-offset option","startedAt":"2006-10-13T05:35:00Z","lastAt":"2006-10-13T22:11:02Z","messageCount":8,"participants":["Junio C Hamano","Nicolas Pitre","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"28712","messageId":"11607177011745-git-send-email-junkio@cox.net","threadId":"5912","inReplyTo":null,"subject":"[PATCH 1/2] pack-objects: document --delta-base-offset option","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-13T05:35:00Z","receivedAt":"2006-10-13T05:35:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Signed-off-by: Junio C Hamano <junkio@cox.net>\n---\n Documentation/git-pack-objects.txt |   13 ++++++++++++-\n builtin-pack-objects.c             |    2 +-\n 2 files changed, 13 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-pack-objects.txt b/Documentation/git-pack-objects.txt\nindex d4661dd..5788709 100644\n--- a/Documentation/git-pack-objects.txt\n+++ b/Documentation/git-pack-objects.txt\n@@ -9,7 +9,7 @@ git-pack-objects - Create a packed archi\n SYNOPSIS\n --------\n [verse]\n-'git-pack-objects' [-q] [--no-reuse-delta] [--non-empty]\n+'git-pack-objects' [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty]\n \t[--local] [--incremental] [--window=N] [--depth=N]\n \t[--revs [--unpacked | --all]*] [--stdout | base-name] < object-list\n \n@@ -110,6 +110,17 @@ base-name::\n \tThis flag tells the command not to reuse existing deltas\n \tbut compute them from scratch.\n \n+--delta-base-offset::\n+\tA packed archive can express base object of a delta as\n+\teither 20-byte object name or as an offset in the\n+\tstream, but older version of git does not understand the\n+\tlatter.  By default, git-pack-objects only uses the\n+\tformer format for better compatibility.  This option\n+\tallows the command to use the latter format for\n+\tcompactness.  Depending on the average delta chain\n+\tlength, this option typically shrinks the resulting\n+\tpackfile by 3-5 per-cent.\n+\n \n Author\n ------\ndiff --git a/builtin-pack-objects.c b/builtin-pack-objects.c\nindex ee5f031..41e1e74 100644\n--- a/builtin-pack-objects.c\n+++ b/builtin-pack-objects.c\n@@ -15,7 +15,7 @@ #include \"list-objects.h\"\n #include <sys/time.h>\n #include <signal.h>\n \n-static const char pack_usage[] = \"git-pack-objects [-q] [--no-reuse-delta] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] [--revs [--unpacked | --all]*] [--stdout | base-name] <ref-list | <object-list]\";\n+static const char pack_usage[] = \"git-pack-objects [-q] [--no-reuse-delta] [--delta-base-offset] [--non-empty] [--local] [--incremental] [--window=N] [--depth=N] [--revs [--unpacked | --all]*] [--stdout | base-name] <ref-list | <object-list]\";\n \n struct object_entry {\n \tunsigned char sha1[20];\n-- \n1.4.3.rc2.g51ca\n"},{"id":"28713","messageId":"11607177024171-git-send-email-junkio@cox.net","threadId":"5912","inReplyTo":"11607177011745-git-send-email-junkio@cox.net","subject":"[PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-13T05:35:01Z","receivedAt":"2006-10-13T05:35:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This new option makes the resulting pack express the delta base\nwith more compact \"offset\" format.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n Documentation/git-repack.txt |    8 +++++++-\n git-repack.sh                |    1 +\n 2 files changed, 8 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/git-repack.txt b/Documentation/git-repack.txt\nindex 49f7e0a..5f5530d 100644\n--- a/Documentation/git-repack.txt\n+++ b/Documentation/git-repack.txt\n@@ -9,7 +9,7 @@ objects into pack files.\n \n SYNOPSIS\n --------\n-'git-repack' [-a] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]\n+'git-repack' [-a] [-b] [-d] [-f] [-l] [-n] [-q] [--window=N] [--depth=N]\n \n DESCRIPTION\n -----------\n@@ -35,6 +35,12 @@ OPTIONS\n \tabout people fetching via dumb protocols from it.  Use\n \twith '-d'.\n \n+-b::\n+\tPass the `--delta-base-offset` to `git pack-objects`;\n+\tsee gitlink:git-pack-objects[1].  Do not use this option\n+\tif you want the repository to be accessible by older\n+\tversions of git.\n+\n -d::\n \tAfter packing, if the newly created packs make some\n \texisting packs redundant, remove the redundant packs.\ndiff --git a/git-repack.sh b/git-repack.sh\nindex b525fc5..25dae5e 100755\n--- a/git-repack.sh\n+++ b/git-repack.sh\n@@ -14,6 +14,7 @@ do\n \t-n)\tno_update_info=t ;;\n \t-a)\tall_into_one=t ;;\n \t-d)\tremove_redundant=t ;;\n+\t-b)\textra=\"$extra --delta-base-offset\" ;;\n \t-q)\tquiet=-q ;;\n \t-f)\tno_reuse_delta=--no-reuse-delta ;;\n \t-l)\tlocal=--local ;;\n-- \n1.4.3.rc2.g51ca\n"},{"id":"28727","messageId":"Pine.LNX.4.64.0610130912500.2435@xanadu.home","threadId":"5912","inReplyTo":"11607177024171-git-send-email-junkio@cox.net","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-10-13T13:20:14Z","receivedAt":"2006-10-13T13:20:14Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Thu, 12 Oct 2006, Junio C Hamano wrote:\n\n> This new option makes the resulting pack express the delta base\n> with more compact \"offset\" format.\n\nActually I thought about making it the default whenever git-pack-objects \nsupported it, and use a negative option with git-repack to disable it \ninstead.\n\nThe fact is that there is little reason for not using delta base offsets \nin most cases and specifying -b all the time would become more of an \nannoyance.\n\nWhat do you think?\n\n\nNicolas\n"},{"id":"28730","messageId":"ego5kp$fm4$1@sea.gmane.org","threadId":"5912","inReplyTo":"Pine.LNX.4.64.0610130912500.2435@xanadu.home","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-13T13:51:31Z","receivedAt":"2006-10-13T13:51:31Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Nicolas Pitre wrote:\n\n> On Thu, 12 Oct 2006, Junio C Hamano wrote:\n> \n>> This new option makes the resulting pack express the delta base\n>> with more compact \"offset\" format.\n> \n> Actually I thought about making it the default whenever git-pack-objects \n> supported it, and use a negative option with git-repack to disable it \n> instead.\n> \n> The fact is that there is little reason for not using delta base offsets \n> in most cases and specifying -b all the time would become more of an \n> annoyance.\n\nPerhaps we should leave it to configuretion variable, instead?\nAnd turn the new format on by default, like core.legacyHeaders\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28745","messageId":"7v64endi6x.fsf@assigned-by-dhcp.cox.net","threadId":"5912","inReplyTo":"Pine.LNX.4.64.0610130912500.2435@xanadu.home","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-13T21:22:46Z","receivedAt":"2006-10-13T21:22:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n> On Thu, 12 Oct 2006, Junio C Hamano wrote:\n>\n>> This new option makes the resulting pack express the delta base\n>> with more compact \"offset\" format.\n>\n> Actually I thought about making it the default whenever git-pack-objects \n> supported it, and use a negative option with git-repack to disable it \n> instead.\n>\n> The fact is that there is little reason for not using delta base offsets \n> in most cases and specifying -b all the time would become more of an \n> annoyance.\n>\n> What do you think?\n\nThe only time it matters is if the packs in repository being\nrepacked needs to be readable by older git, which I think is\nonly when somebody with older git uses commit walkers to\ndownload the pack into a remote repository to use.  Using or not\nusing delta-base-offset is tied to each repository, and in a\nsense that is similar to \"repository format version\".\n\nSo how about\n\n\t[core]\n        \trepackUseDeltaBase = true\n"},{"id":"28746","messageId":"egp0fk$15b$1@sea.gmane.org","threadId":"5912","inReplyTo":"7v64endi6x.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2006-10-13T21:29:35Z","receivedAt":"2006-10-13T21:29:35Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Junio C Hamano wrote:\n\n> So how about\n> \n>         [core]\n>                 repackUseDeltaBase = true\n\n+1, but I'd rather first it default to false.\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"28748","messageId":"Pine.LNX.4.64.0610131757050.2435@xanadu.home","threadId":"5912","inReplyTo":"7v64endi6x.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Nicolas Pitre","fromEmail":"nico@cam.org","sentAt":"2006-10-13T21:58:43Z","receivedAt":"2006-10-13T21:58:43Z","isPatch":true,"sender":{"key":"nico@fluxnic.net","avatar":"https://avatars.githubusercontent.com/u/702790?v=4"},"body":"On Fri, 13 Oct 2006, Junio C Hamano wrote:\n\n> Nicolas Pitre <nico@cam.org> writes:\n> \n> > On Thu, 12 Oct 2006, Junio C Hamano wrote:\n> >\n> >> This new option makes the resulting pack express the delta base\n> >> with more compact \"offset\" format.\n> >\n> > Actually I thought about making it the default whenever git-pack-objects \n> > supported it, and use a negative option with git-repack to disable it \n> > instead.\n> >\n> > The fact is that there is little reason for not using delta base offsets \n> > in most cases and specifying -b all the time would become more of an \n> > annoyance.\n> >\n> > What do you think?\n> \n> The only time it matters is if the packs in repository being\n> repacked needs to be readable by older git, which I think is\n> only when somebody with older git uses commit walkers to\n> download the pack into a remote repository to use.  Using or not\n> using delta-base-offset is tied to each repository, and in a\n> sense that is similar to \"repository format version\".\n> \n> So how about\n> \n> \t[core]\n>         \trepackUseDeltaBase = true\n\nI agree, although \"repackUseDeltaBase\" is a bit vague as both delta \ntypes do use a delta base.\n\n\nNicolas\n"},{"id":"28750","messageId":"7vslhrc1e1.fsf@assigned-by-dhcp.cox.net","threadId":"5912","inReplyTo":"Pine.LNX.4.64.0610131757050.2435@xanadu.home","subject":"Re: [PATCH 2/2] git-repack: -b to pass --delta-base-offset","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-10-13T22:11:02Z","receivedAt":"2006-10-13T22:11:02Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Pitre <nico@cam.org> writes:\n\n>> So how about\n>> \n>> \t[core]\n>>         \trepackUseDeltaBase = true\n>\n> I agree, although \"repackUseDeltaBase\" is a bit vague as both delta \n> types do use a delta base.\n\nTrue; core.repackUseDeltaBaseOffset that is.\n"}]}