{"thread":{"id":"63569","subject":"[PATCH] t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'","startedAt":"2025-06-03T05:32:19Z","lastAt":"2025-06-18T18:38:40Z","messageCount":3,"participants":["Derick W. de M. Frias","Patrick Steinhardt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"519534","messageId":"20250603053137.66249-1-derick.william.moraes@gmail.com","threadId":"63569","inReplyTo":null,"subject":"[PATCH] t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'","fromName":"Derick W. de M. Frias","fromEmail":"derick.william.moraes@gmail.com","sentAt":"2025-06-03T05:20:28Z","receivedAt":"2025-06-03T05:32:19Z","isPatch":true,"sender":{"key":"derick.william.moraes@gmail.com","avatar":null},"body":"From: DerickWMFrias <derick.william.moraes@gmail.com>\n\n'test_path_is_file' and 'test_path_is_dir' are modern path checking\nmethods in Git's development.\n\nThis patch replaces old 'test -d' and 'test -f' methods with them.\n\nSigned-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>\n---\n t/t0200-gettext-basic.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t0200-gettext-basic.sh b/t/t0200-gettext-basic.sh\nindex 8853d8afb9..89d0899a5b 100755\n--- a/t/t0200-gettext-basic.sh\n+++ b/t/t0200-gettext-basic.sh\n@@ -31,12 +31,12 @@ test_expect_success 'xgettext sanity: Comment extraction with --add-comments sto\n '\n \n test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' '\n-    test -d \"$TEXTDOMAINDIR\" &&\n+    test_path_is_dir \"$TEXTDOMAINDIR\" &&\n     test \"$TEXTDOMAINDIR\" = \"$GIT_TEXTDOMAINDIR\"\n '\n \n test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' '\n-    test -f \"$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo\"\n+    test_path_is_file \"$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo\"\n '\n \n # TODO: When we have more locales, generalize this to test them\n-- \n2.49.0.634.g8613c2bb6c.dirty\n\n"},{"id":"519537","messageId":"aD6TJLuuaZmiFUvZ@pks.im","threadId":"63569","inReplyTo":"20250603053137.66249-1-derick.william.moraes@gmail.com","subject":"Re: [PATCH] t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2025-06-03T06:16:04Z","receivedAt":"2025-06-03T06:16:09Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Tue, Jun 03, 2025 at 02:20:28AM -0300, Derick W. de M. Frias wrote:\n> From: DerickWMFrias <derick.william.moraes@gmail.com>\n\nThere is a mismatch between your name here (which would be applied as\nthe patch author) and the Signed-off-by. These two should match.\n\n> 'test_path_is_file' and 'test_path_is_dir' are modern path checking\n> methods in Git's development.\n\nWe typically want to provide enough context in commit messages to state\n_why_ the replacement is better. Them being more \"modern\" isn't yet a\nsufficiently good reason. So it would be great if we explicitly mention\nwhat the replacements bring to the table in a sentence or two.\n\n> This patch replaces old 'test -d' and 'test -f' methods with them.\n\nWe use imperative style for commit messages, as if instructing the code\nto change. So instead of saying \"This patch replaces\", we'd say\n\"Replace `test -d` and `test -f` ...\".\n\nThe patch itself looks obviously good to me, thanks!\n\nPatrick\n"},{"id":"520360","messageId":"20250618183754.108821-1-derick.william.moraes@gmail.com","threadId":"63569","inReplyTo":"aD6TJLuuaZmiFUvZ@pks.im","subject":"[PATCH v2] t0200: replace 'test -d' with 'test_path_is_dir' and 'test -f' with 'test_path_is_file'","fromName":"Derick W. de M. Frias","fromEmail":"derick.william.moraes@gmail.com","sentAt":"2025-06-18T18:31:10Z","receivedAt":"2025-06-18T18:38:40Z","isPatch":true,"sender":{"key":"derick.william.moraes@gmail.com","avatar":null},"body":"Thanks for your feedback Patrick. I'm resending the patch with your\nsuggestions.\n\n'test_path_is_file' and 'test_path_is_dir' are modern debbuging-friendly\npath checking methods in Git's development that output useful messages\nwhen the test fails, unlike 'test -f' and 'test -d' that don't provide \nfeedback.\n\nReplace 'test -d' and 'test -f' methods with 'test_path_is_dir' and\n'test_path_is_file'.\n\nSigned-off-by: Derick W. de M. Frias <derick.william.moraes@gmail.com>\n---\n t/t0200-gettext-basic.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t0200-gettext-basic.sh b/t/t0200-gettext-basic.sh\nindex 8853d8afb9..89d0899a5b 100755\n--- a/t/t0200-gettext-basic.sh\n+++ b/t/t0200-gettext-basic.sh\n@@ -31,12 +31,12 @@ test_expect_success 'xgettext sanity: Comment extraction with --add-comments sto\n '\n \n test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' '\n-    test -d \"$TEXTDOMAINDIR\" &&\n+    test_path_is_dir \"$TEXTDOMAINDIR\" &&\n     test \"$TEXTDOMAINDIR\" = \"$GIT_TEXTDOMAINDIR\"\n '\n \n test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' '\n-    test -f \"$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo\"\n+    test_path_is_file \"$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo\"\n '\n \n # TODO: When we have more locales, generalize this to test them\n-- \n2.50.0.rc0.62.g658f0ae201.dirty\n\n"}]}