Git development
 help / color / mirror / Atom feed
From: Joerg Thalheim <joerg@thalheim.io>
To: git@vger.kernel.org
Cc: "Patrick Steinhardt" <ps@pks.im>,
	"Junio C Hamano" <gitster@pobox.com>,
	"Jörg Thalheim" <joerg@thalheim.io>
Subject: [PATCH] t7703: ignore 'total' line when comparing ls -l output
Date: Mon,  4 May 2026 12:14:29 +0200	[thread overview]
Message-ID: <20260504101429.340123-1-joerg@thalheim.io> (raw)

From: Jörg Thalheim <joerg@thalheim.io>

The 'total N' header from ls -l reports the block count, which on
copy-on-write or compressing filesystems such as ZFS can change between
two back-to-back invocations even when the directory contents are
identical. The MIDX retention checks introduced in 6ce9d558ce
(midx-write: skip rewriting MIDX with --stdin-packs unless needed,
2025-12-11) compare full ls -l output and thus fail spuriously on such
filesystems. Strip the header line before comparing.

Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
---
 t/t7703-repack-geometric.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh
index 04d5d8fc33..9b5a428620 100755
--- a/t/t7703-repack-geometric.sh
+++ b/t/t7703-repack-geometric.sh
@@ -299,9 +299,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX without bi
 		test_path_is_file .git/objects/pack/multi-pack-index &&
 		test-tool chmtime =0 .git/objects/pack/multi-pack-index &&
 
-		ls -l .git/objects/pack/ >expect &&
+		ls -l .git/objects/pack/ | sed 1d >expect &&
 		git repack --geometric=2 --write-midx --no-write-bitmap-index &&
-		ls -l .git/objects/pack/ >actual &&
+		ls -l .git/objects/pack/ | sed 1d >actual &&
 		test_cmp expect actual
 	)
 '
@@ -316,9 +316,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX with bitma
 	test_path_is_file repo/.git/objects/pack/multi-pack-index &&
 	test-tool chmtime =0 repo/.git/objects/pack/multi-pack-index &&
 
-	ls -l repo/.git/objects/pack/ >expect &&
+	ls -l repo/.git/objects/pack/ | sed 1d >expect &&
 	git -C repo repack --geometric=2 --write-midx --write-bitmap-index &&
-	ls -l repo/.git/objects/pack/ >actual &&
+	ls -l repo/.git/objects/pack/ | sed 1d >actual &&
 	test_cmp expect actual
 '
 

base-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0
-- 
2.53.0


             reply	other threads:[~2026-05-04 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 10:14 Joerg Thalheim [this message]
2026-05-05  6:02 ` [PATCH] t7703: ignore 'total' line when comparing ls -l output Patrick Steinhardt

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=20260504101429.340123-1-joerg@thalheim.io \
    --to=joerg@thalheim.io \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    /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