{"thread":{"id":"65588","subject":"[PATCH] t7703: ignore 'total' line when comparing ls -l output","startedAt":"2026-05-04T10:28:01Z","lastAt":"2026-05-05T06:02:49Z","messageCount":2,"participants":["Joerg Thalheim","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"542657","messageId":"20260504101429.340123-1-joerg@thalheim.io","threadId":"65588","inReplyTo":null,"subject":"[PATCH] t7703: ignore 'total' line when comparing ls -l output","fromName":"Joerg Thalheim","fromEmail":"joerg@thalheim.io","sentAt":"2026-05-04T10:14:29Z","receivedAt":"2026-05-04T10:28:01Z","isPatch":true,"body":"From: Jörg Thalheim <joerg@thalheim.io>\n\nThe 'total N' header from ls -l reports the block count, which on\ncopy-on-write or compressing filesystems such as ZFS can change between\ntwo back-to-back invocations even when the directory contents are\nidentical. The MIDX retention checks introduced in 6ce9d558ce\n(midx-write: skip rewriting MIDX with --stdin-packs unless needed,\n2025-12-11) compare full ls -l output and thus fail spuriously on such\nfilesystems. Strip the header line before comparing.\n\nSigned-off-by: Jörg Thalheim <joerg@thalheim.io>\n---\n t/t7703-repack-geometric.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh\nindex 04d5d8fc33..9b5a428620 100755\n--- a/t/t7703-repack-geometric.sh\n+++ b/t/t7703-repack-geometric.sh\n@@ -299,9 +299,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX without bi\n \t\ttest_path_is_file .git/objects/pack/multi-pack-index &&\n \t\ttest-tool chmtime =0 .git/objects/pack/multi-pack-index &&\n \n-\t\tls -l .git/objects/pack/ >expect &&\n+\t\tls -l .git/objects/pack/ | sed 1d >expect &&\n \t\tgit repack --geometric=2 --write-midx --no-write-bitmap-index &&\n-\t\tls -l .git/objects/pack/ >actual &&\n+\t\tls -l .git/objects/pack/ | sed 1d >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -316,9 +316,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX with bitma\n \ttest_path_is_file repo/.git/objects/pack/multi-pack-index &&\n \ttest-tool chmtime =0 repo/.git/objects/pack/multi-pack-index &&\n \n-\tls -l repo/.git/objects/pack/ >expect &&\n+\tls -l repo/.git/objects/pack/ | sed 1d >expect &&\n \tgit -C repo repack --geometric=2 --write-midx --write-bitmap-index &&\n-\tls -l repo/.git/objects/pack/ >actual &&\n+\tls -l repo/.git/objects/pack/ | sed 1d >actual &&\n \ttest_cmp expect actual\n '\n \n\nbase-commit: 94f057755b7941b321fd11fec1b2e3ca5313a4e0\n-- \n2.53.0\n\n"},{"id":"542740","messageId":"afmIAxNKOlRCxwKn@pks.im","threadId":"65588","inReplyTo":"20260504101429.340123-1-joerg@thalheim.io","subject":"Re: [PATCH] t7703: ignore 'total' line when comparing ls -l output","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-05-05T06:02:43Z","receivedAt":"2026-05-05T06:02:49Z","isPatch":true,"body":"On Mon, May 04, 2026 at 12:14:29PM +0200, Joerg Thalheim wrote:\n> diff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh\n> index 04d5d8fc33..9b5a428620 100755\n> --- a/t/t7703-repack-geometric.sh\n> +++ b/t/t7703-repack-geometric.sh\n> @@ -299,9 +299,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX without bi\n>  \t\ttest_path_is_file .git/objects/pack/multi-pack-index &&\n>  \t\ttest-tool chmtime =0 .git/objects/pack/multi-pack-index &&\n>  \n> -\t\tls -l .git/objects/pack/ >expect &&\n> +\t\tls -l .git/objects/pack/ | sed 1d >expect &&\n>  \t\tgit repack --geometric=2 --write-midx --no-write-bitmap-index &&\n> -\t\tls -l .git/objects/pack/ >actual &&\n> +\t\tls -l .git/objects/pack/ | sed 1d >actual &&\n>  \t\ttest_cmp expect actual\n>  \t)\n>  '\n> @@ -316,9 +316,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX with bitma\n>  \ttest_path_is_file repo/.git/objects/pack/multi-pack-index &&\n>  \ttest-tool chmtime =0 repo/.git/objects/pack/multi-pack-index &&\n>  \n> -\tls -l repo/.git/objects/pack/ >expect &&\n> +\tls -l repo/.git/objects/pack/ | sed 1d >expect &&\n>  \tgit -C repo repack --geometric=2 --write-midx --write-bitmap-index &&\n> -\tls -l repo/.git/objects/pack/ >actual &&\n> +\tls -l repo/.git/objects/pack/ | sed 1d >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nHm. So all we're interested in is the mtime of these files as an\nindicator whether they have been rewritten or not. I don't think there's\nan easy, portable via POSIX tooling to retrieve that. But we don't need\nit, because our test-tool already supports this functionality:\n\n    $ test-tool chmtime --get <files>\n\nSo how about we do the below patch instead?\n\nThanks!\n\nPatrick\n\ndiff --git a/t/t7703-repack-geometric.sh b/t/t7703-repack-geometric.sh\nindex 04d5d8fc33..ec7032bf5d 100755\n--- a/t/t7703-repack-geometric.sh\n+++ b/t/t7703-repack-geometric.sh\n@@ -299,9 +299,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX without bi\n \t\ttest_path_is_file .git/objects/pack/multi-pack-index &&\n \t\ttest-tool chmtime =0 .git/objects/pack/multi-pack-index &&\n \n-\t\tls -l .git/objects/pack/ >expect &&\n+\t\ttest-tool chmtime --get .git/objects/pack/* >expect &&\n \t\tgit repack --geometric=2 --write-midx --no-write-bitmap-index &&\n-\t\tls -l .git/objects/pack/ >actual &&\n+\t\ttest-tool chmtime --get .git/objects/pack/* >actual &&\n \t\ttest_cmp expect actual\n \t)\n '\n@@ -316,9 +316,9 @@ test_expect_success '--geometric --write-midx retains up-to-date MIDX with bitma\n \ttest_path_is_file repo/.git/objects/pack/multi-pack-index &&\n \ttest-tool chmtime =0 repo/.git/objects/pack/multi-pack-index &&\n \n-\tls -l repo/.git/objects/pack/ >expect &&\n+\ttest-tool chmtime --get repo/.git/objects/pack/* >expect &&\n \tgit -C repo repack --geometric=2 --write-midx --write-bitmap-index &&\n-\tls -l repo/.git/objects/pack/ >actual &&\n+\ttest-tool chmtime --get repo/.git/objects/pack/* >actual &&\n \ttest_cmp expect actual\n '\n"}]}