{"thread":{"id":"65261","subject":"[PATCH v3] t4200-rerere: use test_path helpers","startedAt":"2026-03-16T07:08:17Z","lastAt":"2026-03-16T16:51:01Z","messageCount":2,"participants":["PRASHANT S BISHT","Junio C Hamano"],"isPatch":true,"patchVersion":3,"patchTotal":null},"messages":[{"id":"539070","messageId":"20260316070812.84760-1-prashantjee2025@gmail.com","threadId":"65261","inReplyTo":null,"subject":"[PATCH v3] t4200-rerere: use test_path helpers","fromName":"PRASHANT S BISHT","fromEmail":"prashantjee2025@gmail.com","sentAt":"2026-03-16T07:08:12Z","receivedAt":"2026-03-16T07:08:17Z","isPatch":true,"sender":{"key":"prashantjee2025@gmail.com","avatar":"https://avatars.githubusercontent.com/u/213211543?v=4"},"body":"Convert assertion-style test -[df] checks in t4200-rerere.sh to test_path_* helpers.\n\nInstances were found with:\n\n\tgit grep 'test -[def]' t/t4200-rerere.sh\n\n---\n t/t4200-rerere.sh | 26 +++++++++++++-------------\n 1 file changed, 13 insertions(+), 13 deletions(-)\n\ndiff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\nindex 204325f4d5..1717f407c8 100755\n--- a/t/t4200-rerere.sh\n+++ b/t/t4200-rerere.sh\n@@ -72,7 +72,7 @@ test_expect_success 'nothing recorded without rerere' '\n \trm -rf .git/rr-cache &&\n \tgit config rerere.enabled false &&\n \ttest_must_fail git merge first &&\n-\t! test -d .git/rr-cache\n+\ttest_path_is_missing .git/rr-cache\n '\n \n test_expect_success 'activate rerere, old style (conflicting merge)' '\n@@ -84,8 +84,8 @@ test_expect_success 'activate rerere, old style (conflicting merge)' '\n \tsha1=$(sed \"s/\t.*//\" .git/MERGE_RR) &&\n \trr=.git/rr-cache/$sha1 &&\n \tgrep \"^=======\\$\" $rr/preimage &&\n-\t! test -f $rr/postimage &&\n-\t! test -f $rr/thisimage\n+\ttest_path_is_missing $rr/postimage &&\n+\ttest_path_is_missing $rr/thisimage\n '\n \n test_expect_success 'rerere.enabled works, too' '\n@@ -110,8 +110,8 @@ test_expect_success 'set up rr-cache' '\n \n test_expect_success 'rr-cache looks sane' '\n \t# no postimage or thisimage yet\n-\t! test -f $rr/postimage &&\n-\t! test -f $rr/thisimage &&\n+\ttest_path_is_missing $rr/postimage &&\n+\ttest_path_is_missing $rr/thisimage &&\n \n \t# preimage has right number of lines\n \tcnt=$(sed -ne \"/^<<<<<<</,/^>>>>>>>/p\" $rr/preimage | wc -l) &&\n@@ -167,7 +167,7 @@ test_expect_success 'first postimage wins' '\n \tgit show first:a1 | sed \"s/To die: t/To die! T/\" >expect &&\n \n \tgit commit -q -a -m \"prefer first over second\" &&\n-\ttest -f $rr/postimage &&\n+\ttest_path_is_file $rr/postimage &&\n \n \toldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&\n \n@@ -190,14 +190,14 @@ test_expect_success 'rerere clear' '\n \tmv $rr/postimage .git/post-saved &&\n \techo \"$sha1\ta1\" | tr \"\\012\" \"\\000\" >.git/MERGE_RR &&\n \tgit rerere clear &&\n-\t! test -d $rr\n+\ttest_path_is_missing $rr\n '\n \n test_expect_success 'leftover directory' '\n \tgit reset --hard &&\n \tmkdir -p $rr &&\n \ttest_must_fail git merge first &&\n-\ttest -f $rr/preimage\n+\ttest_path_is_file $rr/preimage\n '\n \n test_expect_success 'missing preimage' '\n@@ -205,7 +205,7 @@ test_expect_success 'missing preimage' '\n \tmkdir -p $rr &&\n \tcp .git/post-saved $rr/postimage &&\n \ttest_must_fail git merge first &&\n-\ttest -f $rr/preimage\n+\ttest_path_is_file $rr/preimage\n '\n \n test_expect_success 'set up for garbage collection tests' '\n@@ -230,16 +230,16 @@ test_expect_success 'set up for garbage collection tests' '\n \n test_expect_success 'gc preserves young or recently used records' '\n \tgit rerere gc &&\n-\ttest -f $rr/preimage &&\n-\ttest -f $rr2/preimage\n+\ttest_path_is_file $rr/preimage &&\n+\ttest_path_is_file $rr2/preimage\n '\n \n test_expect_success 'old records rest in peace' '\n \ttest-tool chmtime =$just_over_60_days_ago $rr/postimage &&\n \ttest-tool chmtime =$just_over_15_days_ago $rr2/preimage &&\n \tgit rerere gc &&\n-\t! test -f $rr/preimage &&\n-\t! test -f $rr2/preimage\n+\ttest_path_is_missing $rr/preimage &&\n+\ttest_path_is_missing $rr2/preimage\n '\n \n rerere_gc_custom_expiry_test () {\n-- \n2.50.1 (Apple Git-155)\n\n"},{"id":"539131","messageId":"xmqqqzpjpvkc.fsf@gitster.g","threadId":"65261","inReplyTo":"20260316070812.84760-1-prashantjee2025@gmail.com","subject":"Re: [PATCH v3] t4200-rerere: use test_path helpers","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-03-16T16:50:59Z","receivedAt":"2026-03-16T16:51:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"PRASHANT S BISHT <prashantjee2025@gmail.com> writes:\n\n> Convert assertion-style test -[df] checks in t4200-rerere.sh to test_path_* helpers.\n>\n> Instances were found with:\n>\n> \tgit grep 'test -[def]' t/t4200-rerere.sh\n\nPeople seem to add the above to their test-path helper patches, but\nunless the coverage of the work is fairly thorough and you want to\nsay \"all the similar issues should be found with this command and I\naddressed all of them\", I do not see much point saying how you found\none of them and addressed it.\n\nYou could have used \"git grep -e <pattern> -- t/\\*.sh\", or you could\nhave been working to fix something in t9200 and noticed these while\nyou were doing something else to the file.\n\nI do not see it as too huge a deal and it is probably not a cause to\nsend in another iteration once it is already written, though.\n\n>\n> ---\n\nBut the lack of sign-off is reason enough to require an update.  \n\nFor an \"introduction to the project\" patch, the change itself is not\nas important or interesting than demonstrating that you studied\nCodingGuidelines and SubmittingPatches well.\n\n\n>  t/t4200-rerere.sh | 26 +++++++++++++-------------\n>  1 file changed, 13 insertions(+), 13 deletions(-)\n>\n> diff --git a/t/t4200-rerere.sh b/t/t4200-rerere.sh\n> index 204325f4d5..1717f407c8 100755\n> --- a/t/t4200-rerere.sh\n> +++ b/t/t4200-rerere.sh\n> @@ -72,7 +72,7 @@ test_expect_success 'nothing recorded without rerere' '\n>  \trm -rf .git/rr-cache &&\n>  \tgit config rerere.enabled false &&\n>  \ttest_must_fail git merge first &&\n> -\t! test -d .git/rr-cache\n> +\ttest_path_is_missing .git/rr-cache\n>  '\n>  \n>  test_expect_success 'activate rerere, old style (conflicting merge)' '\n> @@ -84,8 +84,8 @@ test_expect_success 'activate rerere, old style (conflicting merge)' '\n>  \tsha1=$(sed \"s/\t.*//\" .git/MERGE_RR) &&\n>  \trr=.git/rr-cache/$sha1 &&\n>  \tgrep \"^=======\\$\" $rr/preimage &&\n> -\t! test -f $rr/postimage &&\n> -\t! test -f $rr/thisimage\n> +\ttest_path_is_missing $rr/postimage &&\n> +\ttest_path_is_missing $rr/thisimage\n>  '\n>  \n>  test_expect_success 'rerere.enabled works, too' '\n> @@ -110,8 +110,8 @@ test_expect_success 'set up rr-cache' '\n>  \n>  test_expect_success 'rr-cache looks sane' '\n>  \t# no postimage or thisimage yet\n> -\t! test -f $rr/postimage &&\n> -\t! test -f $rr/thisimage &&\n> +\ttest_path_is_missing $rr/postimage &&\n> +\ttest_path_is_missing $rr/thisimage &&\n>  \n>  \t# preimage has right number of lines\n>  \tcnt=$(sed -ne \"/^<<<<<<</,/^>>>>>>>/p\" $rr/preimage | wc -l) &&\n> @@ -167,7 +167,7 @@ test_expect_success 'first postimage wins' '\n>  \tgit show first:a1 | sed \"s/To die: t/To die! T/\" >expect &&\n>  \n>  \tgit commit -q -a -m \"prefer first over second\" &&\n> -\ttest -f $rr/postimage &&\n> +\ttest_path_is_file $rr/postimage &&\n>  \n>  \toldmtimepost=$(test-tool chmtime --get -60 $rr/postimage) &&\n>  \n> @@ -190,14 +190,14 @@ test_expect_success 'rerere clear' '\n>  \tmv $rr/postimage .git/post-saved &&\n>  \techo \"$sha1\ta1\" | tr \"\\012\" \"\\000\" >.git/MERGE_RR &&\n>  \tgit rerere clear &&\n> -\t! test -d $rr\n> +\ttest_path_is_missing $rr\n>  '\n>  \n>  test_expect_success 'leftover directory' '\n>  \tgit reset --hard &&\n>  \tmkdir -p $rr &&\n>  \ttest_must_fail git merge first &&\n> -\ttest -f $rr/preimage\n> +\ttest_path_is_file $rr/preimage\n>  '\n>  \n>  test_expect_success 'missing preimage' '\n> @@ -205,7 +205,7 @@ test_expect_success 'missing preimage' '\n>  \tmkdir -p $rr &&\n>  \tcp .git/post-saved $rr/postimage &&\n>  \ttest_must_fail git merge first &&\n> -\ttest -f $rr/preimage\n> +\ttest_path_is_file $rr/preimage\n>  '\n>  \n>  test_expect_success 'set up for garbage collection tests' '\n> @@ -230,16 +230,16 @@ test_expect_success 'set up for garbage collection tests' '\n>  \n>  test_expect_success 'gc preserves young or recently used records' '\n>  \tgit rerere gc &&\n> -\ttest -f $rr/preimage &&\n> -\ttest -f $rr2/preimage\n> +\ttest_path_is_file $rr/preimage &&\n> +\ttest_path_is_file $rr2/preimage\n>  '\n>  \n>  test_expect_success 'old records rest in peace' '\n>  \ttest-tool chmtime =$just_over_60_days_ago $rr/postimage &&\n>  \ttest-tool chmtime =$just_over_15_days_ago $rr2/preimage &&\n>  \tgit rerere gc &&\n> -\t! test -f $rr/preimage &&\n> -\t! test -f $rr2/preimage\n> +\ttest_path_is_missing $rr/preimage &&\n> +\ttest_path_is_missing $rr2/preimage\n>  '\n>  \n>  rerere_gc_custom_expiry_test () {\n"}]}