Git development
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Elia Pinto <gitter.spiros@gmail.com>
Cc: git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH v2 1/4] odb: use size_t for the length of objects to write
Date: Fri, 30 Oct 2026 12:44:34 +0100	[thread overview]
Message-ID: <auSDFRHpLy65PMF_@pks.im> (raw)
In-Reply-To: <8fcb9f10f13962acd5cdac652bea8fc4164f2e78.1793352943.git.gitter.spiros@gmail.com>

On Fri, Oct 30, 2026 at 10:58:50AM +0100, Elia Pinto wrote:
> diff --git a/t/t1007-hash-object.sh b/t/t1007-hash-object.sh
> index 463b38f990..0a89bbb455 100755
> --- a/t/t1007-hash-object.sh
> +++ b/t/t1007-hash-object.sh
> @@ -297,4 +297,17 @@ test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
>  	test_cmp expect actual
>  '
>  
> +test_expect_success EXPENSIVE,SIZE_T_IS_64BIT \
> +		'write filtered files over 4GB correctly' '
> +	{ test -f big || test-tool genzeros $((5*1024*1024*1024)) >big; } &&
> +	test_oid large5GB >expect &&
> +	test_config filter.null-filter.clean "cat" &&
> +	echo "big filter=null-filter" >.gitattributes &&
> +	git hash-object -w -- big >actual &&
> +	test_cmp expect actual &&
> +	echo $((5*1024*1024*1024)) >expect &&

Isn't this the exact same as `big`? So...

> +	git cat-file -s $(cat actual) >actual &&

We shouldn't read from and write to the same file. Maybe write it to
"actual.size" instead?

> +	test_cmp expect actual
> +'

... can't we `test_cmp big actual` here?

Also, it might make sense to use `test_cmp_bin ()` instead.

Patrick

  reply	other threads:[~2026-10-30 11:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21 10:16 [PATCH 0/3] use size_t for a few more object and buffer sizes Elia Pinto
2026-10-21 10:16 ` [PATCH 1/3] odb: use size_t for the length of objects to write Elia Pinto
2026-10-21 11:24   ` Patrick Steinhardt
2026-10-21 10:16 ` [PATCH 2/3] diff: use size_t for the allocation size of word-diff buffers Elia Pinto
2026-10-21 11:24   ` Patrick Steinhardt
2026-10-21 10:16 ` [PATCH 3/3] convert: use size_t for buffer sizes Elia Pinto
2026-10-21 11:24   ` Patrick Steinhardt
2026-10-30  9:58 ` [PATCH v2 0/4] use size_t for a few more object and " Elia Pinto
2026-10-30  9:58   ` [PATCH v2 1/4] odb: use size_t for the length of objects to write Elia Pinto
2026-10-30 11:44     ` Patrick Steinhardt [this message]
2026-10-31 10:16       ` Elia Pinto
2026-10-30  9:58   ` [PATCH v2 2/4] diff: use size_t for the allocation size of word-diff buffers Elia Pinto
2026-10-30  9:58   ` [PATCH v2 3/4] convert: use size_t for buffer sizes Elia Pinto
2026-10-30  9:58   ` [PATCH v2 4/4] convert: use size_t for text statistics and ident counts Elia Pinto
2026-10-30 11:44     ` Patrick Steinhardt
2026-10-31 10:16       ` Elia Pinto
2026-10-31 10:16   ` [PATCH v3 0/4] use size_t for a few more object and buffer sizes Elia Pinto
2026-10-31 10:16     ` [PATCH v3 1/4] odb: use size_t for the length of objects to write Elia Pinto
2026-10-31 10:16     ` [PATCH v3 2/4] diff: use size_t for the allocation size of word-diff buffers Elia Pinto
2026-10-31 10:16     ` [PATCH v3 3/4] convert: use size_t for buffer sizes Elia Pinto
2026-10-31 10:16     ` [PATCH v3 4/4] convert: use size_t for text statistics and ident counts Elia Pinto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=auSDFRHpLy65PMF_@pks.im \
    --to=ps@pks.im \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=gitter.spiros@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox