All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] index-format.txt: mention of v4 is missing in some places
@ 2013-02-22 12:09 Nguyễn Thái Ngọc Duy
  2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
  2013-02-22 20:46 ` [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Junio C Hamano
  0 siblings, 2 replies; 10+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2013-02-22 12:09 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Documentation/technical/index-format.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
index 27c716b..0810251 100644
--- a/Documentation/technical/index-format.txt
+++ b/Documentation/technical/index-format.txt
@@ -12,7 +12,7 @@ Git index format
        The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache")
 
      4-byte version number:
-       The current supported versions are 2 and 3.
+       The current supported versions are 2, 3 and 4.
 
      32-bit number of index entries.
 
@@ -93,8 +93,8 @@ Git index format
     12-bit name length if the length is less than 0xFFF; otherwise 0xFFF
     is stored in this field.
 
-  (Version 3) A 16-bit field, only applicable if the "extended flag"
-  above is 1, split into (high to low bits).
+  (Version 3 or later) A 16-bit field, only applicable if the
+  "extended flag" above is 1, split into (high to low bits).
 
     1-bit reserved for future
 
-- 
1.8.1.2.536.gf441e6d

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

* [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()
  2013-02-22 12:09 [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Nguyễn Thái Ngọc Duy
@ 2013-02-22 12:09 ` Nguyễn Thái Ngọc Duy
  2013-02-22 20:49   ` Junio C Hamano
                     ` (2 more replies)
  2013-02-22 20:46 ` [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Junio C Hamano
  1 sibling, 3 replies; 10+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2013-02-22 12:09 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy

9d22778 (read-cache.c: write prefix-compressed names in the index -
2012-04-04) defined these. Interestingly, they were not used by
read-cache.c, or anywhere in that patch. They were used in
builtin/update-index.c later for checking supported index
versions. Use them here too.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 read-cache.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/read-cache.c b/read-cache.c
index 827ae55..298161f 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1260,7 +1260,8 @@ static int verify_hdr(struct cache_header *hdr, unsigned long size)
 	if (hdr->hdr_signature != htonl(CACHE_SIGNATURE))
 		return error("bad signature");
 	hdr_version = ntohl(hdr->hdr_version);
-	if (hdr_version < 2 || 4 < hdr_version)
+	if (hdr_version < INDEX_FORMAT_LB ||
+	    hdr_version > INDEX_FORMAT_UB)
 		return error("bad index version %d", hdr_version);
 	git_SHA1_Init(&c);
 	git_SHA1_Update(&c, hdr, size - 20);
-- 
1.8.1.2.536.gf441e6d

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

* Re: [PATCH 1/2] index-format.txt: mention of v4 is missing in some places
  2013-02-22 12:09 [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Nguyễn Thái Ngọc Duy
  2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
@ 2013-02-22 20:46 ` Junio C Hamano
  1 sibling, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2013-02-22 20:46 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  Documentation/technical/index-format.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/technical/index-format.txt b/Documentation/technical/index-format.txt
> index 27c716b..0810251 100644
> --- a/Documentation/technical/index-format.txt
> +++ b/Documentation/technical/index-format.txt
> @@ -12,7 +12,7 @@ Git index format
>         The signature is { 'D', 'I', 'R', 'C' } (stands for "dircache")
>  
>       4-byte version number:
> -       The current supported versions are 2 and 3.
> +       The current supported versions are 2, 3 and 4.
>  
>       32-bit number of index entries.
>  
> @@ -93,8 +93,8 @@ Git index format
>      12-bit name length if the length is less than 0xFFF; otherwise 0xFFF
>      is stored in this field.
>  
> -  (Version 3) A 16-bit field, only applicable if the "extended flag"
> -  above is 1, split into (high to low bits).
> +  (Version 3 or later) A 16-bit field, only applicable if the
> +  "extended flag" above is 1, split into (high to low bits).
>  
>      1-bit reserved for future

Depending on how the first later version decides to encode the
additional flag information, "or later" may need to be changed to
"and 4" when it happens.  As we cannot predict the future, I think
"or later" is just as good as "add 4" for now.

Thanks.

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

* Re: [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr()
  2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
@ 2013-02-22 20:49   ` Junio C Hamano
  2013-02-23  1:54   ` [PATCH 3/2] update-index: list supported idx versions and their features Nguyễn Thái Ngọc Duy
  2013-02-23  2:29   ` [PATCH v2 " Nguyễn Thái Ngọc Duy
  2 siblings, 0 replies; 10+ messages in thread
From: Junio C Hamano @ 2013-02-22 20:49 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git

Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:

> 9d22778 (read-cache.c: write prefix-compressed names in the index -
> 2012-04-04) defined these. Interestingly, they were not used by
> read-cache.c, or anywhere in that patch. They were used in
> builtin/update-index.c later for checking supported index
> versions. Use them here too.

Thanks.

> -	if (hdr_version < 2 || 4 < hdr_version)
> +	if (hdr_version < INDEX_FORMAT_LB ||
> +	    hdr_version > INDEX_FORMAT_UB)
>  		return error("bad index version %d", hdr_version);

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

* [PATCH 3/2] update-index: list supported idx versions and their features
  2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
  2013-02-22 20:49   ` Junio C Hamano
@ 2013-02-23  1:54   ` Nguyễn Thái Ngọc Duy
  2013-02-23 20:53     ` Jonathan Nieder
  2013-02-23  2:29   ` [PATCH v2 " Nguyễn Thái Ngọc Duy
  2 siblings, 1 reply; 10+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2013-02-23  1:54 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 .. and the user should know (briefly) the differences between index
 versions too.

 Documentation/git-update-index.txt | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 77a912d..e5aaba5 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -145,7 +145,15 @@ you will need to handle the situation manually.
 
 --index-version <n>::
 	Write the resulting index out in the named on-disk format version.
-	The current default version is 2.
+	Supported versions are 2, 3 and 4. The current default version is 2
+	or 3, depending on whether extra features are used, such as
+	`git add -N`.
++
+	Version 4 performs a simple pathname compression that could
+	reduce index size by 30%-50% on large repositories, which
+	results in faster load time. Version 4 is relatively young
+	(first released in 1.8.0 in October 2012). Other Git
+	implementations may not support it yet.
 
 -z::
 	Only meaningful with `--stdin` or `--index-info`; paths are
-- 
1.8.1.2.536.gf441e6d

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

* [PATCH v2 3/2] update-index: list supported idx versions and their features
  2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
  2013-02-22 20:49   ` Junio C Hamano
  2013-02-23  1:54   ` [PATCH 3/2] update-index: list supported idx versions and their features Nguyễn Thái Ngọc Duy
@ 2013-02-23  2:29   ` Nguyễn Thái Ngọc Duy
  2013-02-23 20:55     ` Jonathan Nieder
  2 siblings, 1 reply; 10+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2013-02-23  2:29 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Nguyễn Thái Ngọc Duy


Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Oops, bogus indentation in the first 3/2

 Documentation/git-update-index.txt | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/git-update-index.txt b/Documentation/git-update-index.txt
index 77a912d..dbb75f4 100644
--- a/Documentation/git-update-index.txt
+++ b/Documentation/git-update-index.txt
@@ -145,7 +145,14 @@ you will need to handle the situation manually.
 
 --index-version <n>::
 	Write the resulting index out in the named on-disk format version.
-	The current default version is 2.
+	Supported versions are 2, 3 and 4. The current default version is 2
+	or 3, depending on whether extra features are used, such as
+	`git add -N`.
++
+Version 4 performs a simple pathname compression that could reduce
+index size by 30%-50% on large repositories, which results in faster
+load time. Version 4 is relatively young (first released in in 1.8.0
+in October 2012). Other Git implementations may not support it yet.
 
 -z::
 	Only meaningful with `--stdin` or `--index-info`; paths are
-- 
1.8.1.2.536.gf441e6d

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

* Re: [PATCH 3/2] update-index: list supported idx versions and their features
  2013-02-23  1:54   ` [PATCH 3/2] update-index: list supported idx versions and their features Nguyễn Thái Ngọc Duy
@ 2013-02-23 20:53     ` Jonathan Nieder
  2013-02-23 21:23       ` Junio C Hamano
  0 siblings, 1 reply; 10+ messages in thread
From: Jonathan Nieder @ 2013-02-23 20:53 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano

Nguyễn Thái Ngọc Duy wrote:

> --- a/Documentation/git-update-index.txt
> +++ b/Documentation/git-update-index.txt
> @@ -145,7 +145,15 @@ you will need to handle the situation manually.
>  
>  --index-version <n>::
>  	Write the resulting index out in the named on-disk format version.
> -	The current default version is 2.
> +	Supported versions are 2, 3 and 4. The current default version is 2
> +	or 3, depending on whether extra features are used, such as
> +	`git add -N`.
> ++
> +	Version 4 performs a simple pathname compression that could
> +	reduce index size by 30%-50% on large repositories, which
> +	results in faster load time. Version 4 is relatively young
> +	(first released in 1.8.0 in October 2012). Other Git
> +	implementations may not support it yet.

Markup nit: the second paragraph needs to be unindented, or asciidoc
will treat it as literal text, including line breaks.

Usage nit: s/could/can/

Clarity nit: something like "such as JGit and libgit2" after "Other
Git implementations" would make it clearer, at least to my eyes.

Aside from that, this looks like a good change.

Thanks,
Jonathan

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

* Re: [PATCH v2 3/2] update-index: list supported idx versions and their features
  2013-02-23  2:29   ` [PATCH v2 " Nguyễn Thái Ngọc Duy
@ 2013-02-23 20:55     ` Jonathan Nieder
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Nieder @ 2013-02-23 20:55 UTC (permalink / raw)
  To: Nguyễn Thái Ngọc Duy; +Cc: git, Junio C Hamano

Nguyễn Thái Ngọc Duy wrote:

>  Oops, bogus indentation in the first 3/2

Oops, I missed this.  Ok, ignore the comment on indentation on v1. :)

With or without the other changes I suggested,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

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

* Re: [PATCH 3/2] update-index: list supported idx versions and their features
  2013-02-23 20:53     ` Jonathan Nieder
@ 2013-02-23 21:23       ` Junio C Hamano
  2013-02-23 21:53         ` Jonathan Nieder
  0 siblings, 1 reply; 10+ messages in thread
From: Junio C Hamano @ 2013-02-23 21:23 UTC (permalink / raw)
  To: Jonathan Nieder; +Cc: Nguyễn Thái Ngọc Duy, git

Thanks, both.

Jonathan Nieder <jrnieder@gmail.com> writes:

> Nguyễn Thái Ngọc Duy wrote:
> ...
>> +	Version 4 performs a simple pathname compression that could
>> +	reduce index size by 30%-50% on large repositories, which
>> +	results in faster load time. Version 4 is relatively young
>> +	(first released in 1.8.0 in October 2012). Other Git
>> +	implementations may not support it yet.
>
> Usage nit: s/could/can/

I think s/could reduce/reduces/ is even simpler.

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

* Re: [PATCH 3/2] update-index: list supported idx versions and their features
  2013-02-23 21:23       ` Junio C Hamano
@ 2013-02-23 21:53         ` Jonathan Nieder
  0 siblings, 0 replies; 10+ messages in thread
From: Jonathan Nieder @ 2013-02-23 21:53 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nguyễn Thái Ngọc Duy, git

Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
>> Nguyễn Thái Ngọc Duy wrote:

>>> +	Version 4 performs a simple pathname compression that could
>>> +	reduce index size by 30%-50% on large repositories, which
>>> +	results in faster load time. Version 4 is relatively young
>>> +	(first released in 1.8.0 in October 2012). Other Git
>>> +	implementations may not support it yet.
>>
>> Usage nit: s/could/can/
>
> I think s/could reduce/reduces/ is even simpler.

Yes, true.  Thanks.

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

end of thread, other threads:[~2013-02-23 21:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 12:09 [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Nguyễn Thái Ngọc Duy
2013-02-22 12:09 ` [PATCH 2/2] read-cache.c: use INDEX_FORMAT_{LB,UB} in verify_hdr() Nguyễn Thái Ngọc Duy
2013-02-22 20:49   ` Junio C Hamano
2013-02-23  1:54   ` [PATCH 3/2] update-index: list supported idx versions and their features Nguyễn Thái Ngọc Duy
2013-02-23 20:53     ` Jonathan Nieder
2013-02-23 21:23       ` Junio C Hamano
2013-02-23 21:53         ` Jonathan Nieder
2013-02-23  2:29   ` [PATCH v2 " Nguyễn Thái Ngọc Duy
2013-02-23 20:55     ` Jonathan Nieder
2013-02-22 20:46 ` [PATCH 1/2] index-format.txt: mention of v4 is missing in some places Junio C Hamano

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.