{"thread":{"id":"32972","subject":"[PATCH 1/2] index-format.txt: mention of v4 is missing in some places","startedAt":"2013-02-22T12:09:23Z","lastAt":"2013-02-23T21:53:19Z","messageCount":10,"participants":["Nguyễn Thái Ngọc Duy","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"210025","messageId":"1361534964-4232-1-git-send-email-pclouds@gmail.com","threadId":"32972","inReplyTo":null,"subject":"[PATCH 1/2] index-format.txt: mention of v4 is missing in some places","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-02-22T12:09:23Z","receivedAt":"2013-02-22T12:09:23Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Documentation/technical/index-format.txt | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt\nindex 27c716b..0810251 100644\n--- a/Documentation/technical/index-format.txt\n+++ b/Documentation/technical/index-format.txt\n@@ -12,7 +12,7 @@ Git index format\n        The signature is { 'D', 'I', 'R', 'C' } (stands for \"dircache\")\n \n      4-byte version number:\n-       The current supported versions are 2 and 3.\n+       The current supported versions are 2, 3 and 4.\n \n      32-bit number of index entries.\n \n@@ -93,8 +93,8 @@ Git index format\n     12-bit name length if the length is less than 0xFFF; otherwise 0xFFF\n     is stored in this field.\n \n-  (Version 3) A 16-bit field, only applicable if the \"extended flag\"\n-  above is 1, split into (high to low bits).\n+  (Version 3 or later) A 16-bit field, only applicable if the\n+  \"extended flag\" above is 1, split into (high to low bits).\n \n     1-bit reserved for future\n \n-- \n1.8.1.2.536.gf441e6d\n"},{"id":"210026","messageId":"1361534964-4232-2-git-send-email-pclouds@gmail.com","threadId":"32972","inReplyTo":"1361534964-4232-1-git-send-email-pclouds@gmail.com","subject":"[PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-02-22T12:09:24Z","receivedAt":"2013-02-22T12:09:24Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"9d22778 (read-cache.c: write prefix-compressed names in the index -\n2012-04-04) defined these. Interestingly, they were not used by\nread-cache.c, or anywhere in that patch. They were used in\nbuiltin/update-index.c later for checking supported index\nversions. Use them here too.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n read-cache.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex 827ae55..298161f 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1260,7 +1260,8 @@ static int verify_hdr(struct cache_header *hdr, unsigned long size)\n \tif (hdr->hdr_signature != htonl(CACHE_SIGNATURE))\n \t\treturn error(\"bad signature\");\n \thdr_version = ntohl(hdr->hdr_version);\n-\tif (hdr_version < 2 || 4 < hdr_version)\n+\tif (hdr_version < INDEX_FORMAT_LB ||\n+\t    hdr_version > INDEX_FORMAT_UB)\n \t\treturn error(\"bad index version %d\", hdr_version);\n \tgit_SHA1_Init(&c);\n \tgit_SHA1_Update(&c, hdr, size - 20);\n-- \n1.8.1.2.536.gf441e6d\n"},{"id":"210053","messageId":"7vr4k8cc0b.fsf@alter.siamese.dyndns.org","threadId":"32972","inReplyTo":"1361534964-4232-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 1/2] index-format.txt: mention of v4 is missing in some places","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-22T20:46:44Z","receivedAt":"2013-02-22T20:46:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n> ---\n>  Documentation/technical/index-format.txt | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n>\n> diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt\n> index 27c716b..0810251 100644\n> --- a/Documentation/technical/index-format.txt\n> +++ b/Documentation/technical/index-format.txt\n> @@ -12,7 +12,7 @@ Git index format\n>         The signature is { 'D', 'I', 'R', 'C' } (stands for \"dircache\")\n>  \n>       4-byte version number:\n> -       The current supported versions are 2 and 3.\n> +       The current supported versions are 2, 3 and 4.\n>  \n>       32-bit number of index entries.\n>  \n> @@ -93,8 +93,8 @@ Git index format\n>      12-bit name length if the length is less than 0xFFF; otherwise 0xFFF\n>      is stored in this field.\n>  \n> -  (Version 3) A 16-bit field, only applicable if the \"extended flag\"\n> -  above is 1, split into (high to low bits).\n> +  (Version 3 or later) A 16-bit field, only applicable if the\n> +  \"extended flag\" above is 1, split into (high to low bits).\n>  \n>      1-bit reserved for future\n\nDepending on how the first later version decides to encode the\nadditional flag information, \"or later\" may need to be changed to\n\"and 4\" when it happens.  As we cannot predict the future, I think\n\"or later\" is just as good as \"add 4\" for now.\n\nThanks.\n"},{"id":"210054","messageId":"7vmwuwcbw3.fsf@alter.siamese.dyndns.org","threadId":"32972","inReplyTo":"1361534964-4232-2-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-22T20:49:16Z","receivedAt":"2013-02-22T20:49:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:\n\n> 9d22778 (read-cache.c: write prefix-compressed names in the index -\n> 2012-04-04) defined these. Interestingly, they were not used by\n> read-cache.c, or anywhere in that patch. They were used in\n> builtin/update-index.c later for checking supported index\n> versions. Use them here too.\n\nThanks.\n\n> -\tif (hdr_version < 2 || 4 < hdr_version)\n> +\tif (hdr_version < INDEX_FORMAT_LB ||\n> +\t    hdr_version > INDEX_FORMAT_UB)\n>  \t\treturn error(\"bad index version %d\", hdr_version);\n"},{"id":"210081","messageId":"1361584468-11820-1-git-send-email-pclouds@gmail.com","threadId":"32972","inReplyTo":"1361534964-4232-2-git-send-email-pclouds@gmail.com","subject":"[PATCH 3/2] update-index: list supported idx versions and their features","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-02-23T01:54:28Z","receivedAt":"2013-02-23T01:54:28Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n .. and the user should know (briefly) the differences between index\n versions too.\n\n Documentation/git-update-index.txt | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 77a912d..e5aaba5 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -145,7 +145,15 @@ you will need to handle the situation manually.\n \n --index-version <n>::\n \tWrite the resulting index out in the named on-disk format version.\n-\tThe current default version is 2.\n+\tSupported versions are 2, 3 and 4. The current default version is 2\n+\tor 3, depending on whether extra features are used, such as\n+\t`git add -N`.\n++\n+\tVersion 4 performs a simple pathname compression that could\n+\treduce index size by 30%-50% on large repositories, which\n+\tresults in faster load time. Version 4 is relatively young\n+\t(first released in 1.8.0 in October 2012). Other Git\n+\timplementations may not support it yet.\n \n -z::\n \tOnly meaningful with `--stdin` or `--index-info`; paths are\n-- \n1.8.1.2.536.gf441e6d\n"},{"id":"210082","messageId":"1361586571-12917-1-git-send-email-pclouds@gmail.com","threadId":"32972","inReplyTo":"1361534964-4232-2-git-send-email-pclouds@gmail.com","subject":"[PATCH v2 3/2] update-index: list supported idx versions and their features","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2013-02-23T02:29:31Z","receivedAt":"2013-02-23T02:29:31Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n Oops, bogus indentation in the first 3/2\n\n Documentation/git-update-index.txt | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt\nindex 77a912d..dbb75f4 100644\n--- a/Documentation/git-update-index.txt\n+++ b/Documentation/git-update-index.txt\n@@ -145,7 +145,14 @@ you will need to handle the situation manually.\n \n --index-version <n>::\n \tWrite the resulting index out in the named on-disk format version.\n-\tThe current default version is 2.\n+\tSupported versions are 2, 3 and 4. The current default version is 2\n+\tor 3, depending on whether extra features are used, such as\n+\t`git add -N`.\n++\n+Version 4 performs a simple pathname compression that could reduce\n+index size by 30%-50% on large repositories, which results in faster\n+load time. Version 4 is relatively young (first released in in 1.8.0\n+in October 2012). Other Git implementations may not support it yet.\n \n -z::\n \tOnly meaningful with `--stdin` or `--index-info`; paths are\n-- \n1.8.1.2.536.gf441e6d\n"},{"id":"210105","messageId":"20130223205356.GC3222@elie.Belkin","threadId":"32972","inReplyTo":"1361584468-11820-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH 3/2] update-index: list supported idx versions and their features","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-23T20:53:56Z","receivedAt":"2013-02-23T20:53:56Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyễn Thái Ngọc Duy wrote:\n\n> --- a/Documentation/git-update-index.txt\n> +++ b/Documentation/git-update-index.txt\n> @@ -145,7 +145,15 @@ you will need to handle the situation manually.\n>  \n>  --index-version <n>::\n>  \tWrite the resulting index out in the named on-disk format version.\n> -\tThe current default version is 2.\n> +\tSupported versions are 2, 3 and 4. The current default version is 2\n> +\tor 3, depending on whether extra features are used, such as\n> +\t`git add -N`.\n> ++\n> +\tVersion 4 performs a simple pathname compression that could\n> +\treduce index size by 30%-50% on large repositories, which\n> +\tresults in faster load time. Version 4 is relatively young\n> +\t(first released in 1.8.0 in October 2012). Other Git\n> +\timplementations may not support it yet.\n\nMarkup nit: the second paragraph needs to be unindented, or asciidoc\nwill treat it as literal text, including line breaks.\n\nUsage nit: s/could/can/\n\nClarity nit: something like \"such as JGit and libgit2\" after \"Other\nGit implementations\" would make it clearer, at least to my eyes.\n\nAside from that, this looks like a good change.\n\nThanks,\nJonathan\n"},{"id":"210106","messageId":"20130223205514.GD3222@elie.Belkin","threadId":"32972","inReplyTo":"1361586571-12917-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH v2 3/2] update-index: list supported idx versions and their features","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-23T20:55:14Z","receivedAt":"2013-02-23T20:55:14Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Nguyễn Thái Ngọc Duy wrote:\n\n>  Oops, bogus indentation in the first 3/2\n\nOops, I missed this.  Ok, ignore the comment on indentation on v1. :)\n\nWith or without the other changes I suggested,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n"},{"id":"210108","messageId":"7vk3py7mi5.fsf@alter.siamese.dyndns.org","threadId":"32972","inReplyTo":"20130223205356.GC3222@elie.Belkin","subject":"Re: [PATCH 3/2] update-index: list supported idx versions and their features","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-02-23T21:23:30Z","receivedAt":"2013-02-23T21:23:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks, both.\n\nJonathan Nieder <jrnieder@gmail.com> writes:\n\n> Nguyễn Thái Ngọc Duy wrote:\n> ...\n>> +\tVersion 4 performs a simple pathname compression that could\n>> +\treduce index size by 30%-50% on large repositories, which\n>> +\tresults in faster load time. Version 4 is relatively young\n>> +\t(first released in 1.8.0 in October 2012). Other Git\n>> +\timplementations may not support it yet.\n>\n> Usage nit: s/could/can/\n\nI think s/could reduce/reduces/ is even simpler.\n"},{"id":"210111","messageId":"20130223215319.GF3222@elie.Belkin","threadId":"32972","inReplyTo":"7vk3py7mi5.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 3/2] update-index: list supported idx versions and their features","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-23T21:53:19Z","receivedAt":"2013-02-23T21:53:19Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Junio C Hamano wrote:\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n>> Nguyễn Thái Ngọc Duy wrote:\n\n>>> +\tVersion 4 performs a simple pathname compression that could\n>>> +\treduce index size by 30%-50% on large repositories, which\n>>> +\tresults in faster load time. Version 4 is relatively young\n>>> +\t(first released in 1.8.0 in October 2012). Other Git\n>>> +\timplementations may not support it yet.\n>>\n>> Usage nit: s/could/can/\n>\n> I think s/could reduce/reduces/ is even simpler.\n\nYes, true.  Thanks.\n"}]}