From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b5-smtp.messagingengine.com (fout-b5-smtp.messagingengine.com [202.12.124.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0FD76426694 for ; Mon, 3 Aug 2026 17:21:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.148 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785777716; cv=none; b=BIC/gMiGeqwPKP0CUVWWalyt9FjUS33oH1XvR1LKzJRSzmkHZminc34iD6xNBsWUN3RYZMc9H3+kec12XtAtEZwF62Euxo1DBM51pPovqVS3HGnHU0PsJIKf/xnPGwjFGD1PFcf9AtlUaoDy+Gh785Wya2kp69PBZwfA0+HnUSc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785777716; c=relaxed/simple; bh=9FioILSdKij3sml3Li4oqtFlFdsv0AH4TUwVrA4WZHs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=VxvaDnuoFgmsYQkjP65u41Y5FKQjJA8CAPWq8Z+n3AH5Q+ujoEJEiLIthlsmR5i9Lj3TI9ixebU1z4vWSvU0u8mL71ZsIKTv6Tvosh+jmGaAGJ3znvGjeZgNknDB0PjvUcs2QIJSxcqWBeCfg9zZetWD9/drtRI8WPjKKFdLJc4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=boMPHbUU; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Z6AOO3Ss; arc=none smtp.client-ip=202.12.124.148 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="boMPHbUU"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z6AOO3Ss" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfout.stl.internal (Postfix) with ESMTP id 3EF701D000C9; Mon, 3 Aug 2026 13:21:53 -0400 (EDT) Received: from phl-frontend-01 ([10.202.2.160]) by phl-compute-10.internal (MEProxy); Mon, 03 Aug 2026 13:21:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1785777713; x=1785864113; bh=5Pq/e046Rx n9ehW64/orB2quTA7xqgDrgb6xva36S3E=; b=boMPHbUUhwMQW0FHyk6Yk9FO+l RHDJ1bPKWmh64HrA/KF5fy4YLE6d9Im9tzWMvs7h5rX6I9fV6Ywc/x9wK4lBPJBJ iVnxNAFngenGmbai+UIzvuZXrxdW2QO8tDVAR+Nzc/LKJcYFHpO5SLbIDDOyz27R d4ZqU/SLgdIjU5sBnykyWVhBOr+438h8YE5zTGQcQg33F5TXfjiXQFtUDevZwQrp 9sbhMfOukmTIcUiXee4AGApYl1ePrUZfv8anaRQQbqejo3oOPlInG7Ddsf6opBjh 09FGtQ5iPBD/X8HcRmLnrS5kAXRuhR05nBNhJFWdtPlAKj1Mx6b4DkDod7+g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1785777713; x=1785864113; bh=5Pq/e046Rxn9ehW64/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eHsZK8n2BgYnUuxB0ieUr8HhTw X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Aug 2026 13:21:52 -0400 (EDT) From: Junio C Hamano To: Pablo Sabater Cc: git@vger.kernel.org, chandrapratap3519@gmail.com, karthik.188@gmail.com, peff@peff.net Subject: Re: [PATCH GSoC v3 1/8] t5701: use test_file_size() to get the size of a file In-Reply-To: <20260803-objecttype-support-v3-1-7176fecf7950@gmail.com> (Pablo Sabater's message of "Mon, 03 Aug 2026 16:39:28 +0200") References: <20260803-objecttype-support-v3-0-7176fecf7950@gmail.com> <20260803-objecttype-support-v3-1-7176fecf7950@gmail.com> Date: Mon, 03 Aug 2026 10:21:51 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Pablo Sabater writes: > The 'basics of object-info' test runs 'wc -c | xargs' twice to get the > size of two.t. The pipe to xargs is only there to strip the blanks > that some platforms pad the output of wc with. > > Use the test_file_size() helper, which outputs the size directly, and > store the result in a variable. Because 'git rev-parse two:two.t' is > also run twice, store its output in a variable as well. It also has the benefit of retaining the exit status from commands run inside a $( ... ) construct placed within a HERE-document. Earlier, if your "git rev-parse" failed, you would not have noticed it directly (though you would probably have seen the "expect" file containing unexpected content). Now your assignment fails when you compute two_oid, if your "git rev-parse" segfaults. > Mentored-by: Karthik Nayak > Mentored-by: Chandra Pratap > Signed-off-by: Pablo Sabater > --- > t/t5701-git-serve.sh | 11 +++++++---- > 1 file changed, 7 insertions(+), 4 deletions(-) > > diff --git a/t/t5701-git-serve.sh b/t/t5701-git-serve.sh > index 9a575aa098..51d5dd1ae6 100755 > --- a/t/t5701-git-serve.sh > +++ b/t/t5701-git-serve.sh > @@ -344,20 +344,23 @@ test_expect_success 'unexpected lines are not allowed in fetch request' ' > test_expect_success 'basics of object-info' ' > test_config transfer.advertiseObjectInfo true && > > + two_oid=$(git rev-parse two:two.t) && > + two_size=$(test_file_size two.t) && > + > test-tool pkt-line pack >in <<-EOF && > command=object-info > object-format=$(test_oid algo) > 0001 > size > - oid $(git rev-parse two:two.t) > - oid $(git rev-parse two:two.t) > + oid $two_oid > + oid $two_oid > 0000 > EOF > > cat >expect <<-EOF && > size > - $(git rev-parse two:two.t) $(wc -c - $(git rev-parse two:two.t) $(wc -c + $two_oid $two_size > + $two_oid $two_size > 0000 > EOF