{"thread":{"id":"65243","subject":"[PATCH v2] t/pack-refs-tests: use test_path_is_missing","startedAt":"2026-03-14T03:47:32Z","lastAt":"2026-03-14T05:00:37Z","messageCount":2,"participants":["Ritesh Singh Jadoun","Junio C Hamano"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"538949","messageId":"20260314034617.1261-1-riteshjd75@gmail.com","threadId":"65243","inReplyTo":null,"subject":"[PATCH v2] t/pack-refs-tests: use test_path_is_missing","fromName":"Ritesh Singh Jadoun","fromEmail":"riteshjd75@gmail.com","sentAt":"2026-03-14T03:46:17Z","receivedAt":"2026-03-14T03:47:32Z","isPatch":true,"sender":{"key":"riteshjd75@gmail.com","avatar":"https://avatars.githubusercontent.com/u/181055371?v=4"},"body":"The pack-refs tests currently use raw 'test -f' checks with negation.\nUpdate them to use Git's standard helper function test_path_is_missing\nfor clearer failure reporting.\n\nSigned-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>\n---\n t/pack-refs-tests.sh | 14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh\nindex dca0c77ca1..3cc4906f05 100644\n--- a/t/pack-refs-tests.sh\n+++ b/t/pack-refs-tests.sh\n@@ -61,7 +61,7 @@ test_expect_success 'see if a branch still exists after git ${pack_refs} --prune\n test_expect_success 'see if git ${pack_refs} --prune remove ref files' '\n \tgit branch f &&\n \tgit ${pack_refs} --all --prune &&\n-\t! test_path_is_file .git/refs/heads/f\n+\ttest_path_is_missing .git/refs/heads/f\n '\n \n test_expect_success 'see if git ${pack_refs} --prune removes empty dirs' '\n@@ -113,14 +113,14 @@ test_expect_success 'test excluded refs are not packed' '\n \tgit ${pack_refs} --all --exclude \"refs/heads/dont_pack*\" &&\n \ttest_path_is_file .git/refs/heads/dont_pack1 &&\n \ttest_path_is_file .git/refs/heads/dont_pack2 &&\n-\t! test_path_is_file .git/refs/heads/pack_this'\n+\ttest_path_is_missing .git/refs/heads/pack_this'\n \n test_expect_success 'test --no-exclude refs clears excluded refs' '\n \tgit branch dont_pack3 &&\n \tgit branch dont_pack4 &&\n \tgit ${pack_refs} --all --exclude \"refs/heads/dont_pack*\" --no-exclude &&\n-\t! test_path_is_file .git/refs/heads/dont_pack3 &&\n-\t! test_path_is_file .git/refs/heads/dont_pack4'\n+\ttest_path_is_missing .git/refs/heads/dont_pack3 &&\n+\ttest_path_is_missing .git/refs/heads/dont_pack4'\n \n test_expect_success 'test only included refs are packed' '\n \tgit branch pack_this1 &&\n@@ -128,8 +128,8 @@ test_expect_success 'test only included refs are packed' '\n \tgit tag dont_pack5 &&\n \tgit ${pack_refs} --include \"refs/heads/pack_this*\" &&\n \ttest_path_is_file .git/refs/tags/dont_pack5 &&\n-\t! test_path_is_file .git/refs/heads/pack_this1 &&\n-\t! test_path_is_file .git/refs/heads/pack_this2'\n+\ttest_path_is_missing .git/refs/heads/pack_this1 &&\n+\ttest_path_is_missing .git/refs/heads/pack_this2'\n \n test_expect_success 'test --no-include refs clears included refs' '\n \tgit branch pack1 &&\n@@ -147,7 +147,7 @@ test_expect_success 'see if up-to-date packed refs are preserved' '\n \tgit branch q &&\n \tgit ${pack_refs} --all --prune &&\n \tgit update-ref refs/heads/q refs/heads/q &&\n-\t! test_path_is_file .git/refs/heads/q\n+\ttest_path_is_missing .git/refs/heads/q\n '\n \n test_expect_success 'pack, prune and repack' '\n-- \n2.46.0.windows.1\n\n"},{"id":"538952","messageId":"xmqqfr63xax9.fsf@gitster.g","threadId":"65243","inReplyTo":"20260314034617.1261-1-riteshjd75@gmail.com","subject":"Re: [PATCH v2] t/pack-refs-tests: use test_path_is_missing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-14T05:00:34Z","receivedAt":"2026-03-14T05:00:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ritesh Singh Jadoun <riteshjd75@gmail.com> writes:\n\n> The pack-refs tests currently use raw 'test -f' checks with negation.\n> Update them to use Git's standard helper function test_path_is_missing\n> for clearer failure reporting.\n>\n> Signed-off-by: Ritesh Singh Jadoun <riteshjd75@gmail.com>\n> ---\n>  t/pack-refs-tests.sh | 14 +++++++-------\n>  1 file changed, 7 insertions(+), 7 deletions(-)\n\n> diff --git a/t/pack-refs-tests.sh b/t/pack-refs-tests.sh\n> index dca0c77ca1..3cc4906f05 100644\n> --- a/t/pack-refs-tests.sh\n> +++ b/t/pack-refs-tests.sh\n> @@ -61,7 +61,7 @@ test_expect_success 'see if a branch still exists after git ${pack_refs} --prune\n>  test_expect_success 'see if git ${pack_refs} --prune remove ref files' '\n>  \tgit branch f &&\n>  \tgit ${pack_refs} --all --prune &&\n> -\t! test_path_is_file .git/refs/heads/f\n> +\ttest_path_is_missing .git/refs/heads/f\n>  '\n\nThis test in my tree looks like this:\n\n        test_expect_success 'see if git ${pack_refs} --prune remove ref files' '\n                git branch f &&\n                git ${pack_refs} --all --prune &&\n                ! test -f .git/refs/heads/f\n        '\n\nNo patch that turns this instance of \"! test -f\" into an incorrect\nuse of test_path_is_file helper, i.e., \"!  test_path_is_file\", has\never been accepted to my tree.  Which means that this [v2] will not\napply to my tree.\n\nI suspect that you have two patches on top of my tree, one is a\nbotched attempt that turns \"! test -f\" into \"!  test_path_is_file\",\nand the other one is an \"oops, the previous one was a bad change, so\nfix it on top with another commit\" that further changes it to\n\"test_path_is_missing\", and we are looking only at the latter patch.\n\nWe however do not work that way around here.  Until a patch is\naccepted and merged to the 'next' branch, updates are expected to\ncome as wholesale replacements.  See Documentation/SubmittingPatches.\n\nEven though no developer is perfect, when you are presenting your\nupdated work, armed with wisdom borrowed from your reviewers'\ncomments on your earlier attempts, you are expected to take the\nopportunity to pretend to have written a series of patches that are\nperfect logical progression towards the final shape of the code\nwithout detours, change of plans, and fixing earlier mistakes made\nin the series.\n\nThe final series accepted by the project will have to stay in our\nhistory for later developers to see in \"git log\" output to learn\nfrom, and a series being clean logical progression is a must for\nthat to happen.\n\nIn this case, if what you have is indeed a pair of patches \"one went\ninto a wrong direction, the next corrects the course\", then you\nwould want to squash them into a single patch that turns \"! test -f\n.git/refs/heads/f\" that is in my tree into an improved form that is\n\"test_path_is_missing\".  And send that as the second attempt (v2).\n\nSee also\n\n    https://lore.kernel.org/git/xmqq34283b12.fsf@gitster.g/\n\nThanks.\n\n\n"}]}