git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 2/4] pack-objects, streaming: turn "xx >= big_file_threshold" to ".. > .."

From
Junio C Hamano <gitster@pobox.com>
Date
May 18, 2012, 21:05 UTC
Message-ID
<xmqqk4092o9g.fsf@junio.mtv.corp.google.com>
In-Reply-To
<1337169731-23416-2-git-send-email-pclouds@gmail.com>
Nguyễn Thái Ngọc Duy  <pclouds@gmail.com> writes:
Show 8 quoted lines
> This is because all other places do "xx > big_file_threshold"
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
>  Without two comparisons I added recently in archive-*.c, it's still
>  inconsistent (two xx >= big_file and one xx > big_file).  I have no
>  preference between > and >=. If some of you vote >=, I'll update the
>  patch.

Thanks; I do not have huge preference between the two, but "I want special treatment for anything bigger than 2MiB" is probably more natural than "I want special treatment for things that are exactly 2MiB and also things bigger than that threashold".

Show 30 quoted lines
>  builtin/pack-objects.c |    2 +-
>  streaming.c            |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
> index 1861093..b2e0940 100644
> --- a/builtin/pack-objects.c
> +++ b/builtin/pack-objects.c
> @@ -1327,7 +1327,7 @@ static void get_object_details(void)
>  	for (i = 0; i < nr_objects; i++) {
>  		struct object_entry *entry = sorted_by_offset[i];
>  		check_object(entry);
> -		if (big_file_threshold <= entry->size)
> +		if (big_file_threshold < entry->size)
>  			entry->no_try_delta = 1;
>  	}
>  
> diff --git a/streaming.c b/streaming.c
> index 38b39cd..829ce7d 100644
> --- a/streaming.c
> +++ b/streaming.c
> @@ -121,7 +121,7 @@ static enum input_source istream_source(const unsigned char *sha1,
>  	case OI_LOOSE:
>  		return loose;
>  	case OI_PACKED:
> -		if (!oi->u.packed.is_delta && big_file_threshold <= size)
> +		if (!oi->u.packed.is_delta && big_file_threshold < size)
>  			return pack_non_delta;
>  		/* fallthru */
>  	default:
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 11 of 16 in “pack-objects: use streaming interface for reading large loose blobs”
  1. pack-objects: use streaming interface for reading large loose blobsNguyễn Thái Ngọc Duy, May 12, 2012
  2. Nicolas PitreMay 12, 2012
  3. pack-objects: use streaming interface for reading large loose blobsNguyễn Thái Ngọc Duy, May 13, 2012
  4. Junio C HamanoMay 14, 2012
  5. Junio C HamanoMay 14, 2012
  6. Nguyen Thai Ngoc DuyMay 15, 2012
  7. Junio C HamanoMay 15, 2012
  8. Nguyen Thai Ngoc DuyMay 16, 2012
  9. 1/4 streaming: allow to call close_istream(NULL);Nguyễn Thái Ngọc Duy, May 16, 2012
  10. 2/4 pack-objects, streaming: turn "xx >= big_file_threshold" to ".. > .."Nguyễn Thái Ngọc Duy, May 16, 2012
  11. Junio C HamanoMay 18, 2012
  12. 3/4 pack-objects: refactor write_object()Nguyễn Thái Ngọc Duy, May 16, 2012
  13. Junio C HamanoMay 18, 2012
  14. Nicolas PitreMay 19, 2012
  15. 4/4 pack-objects: use streaming interface for reading large loose blobsNguyễn Thái Ngọc Duy, May 16, 2012
  16. Junio C HamanoMay 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.