{"thread":{"id":"64900","subject":"Re: [PATCH] [GSoC][PATCH] t9160:modernize test path checking","startedAt":"2026-02-02T13:36:19Z","lastAt":"2026-02-02T13:47:03Z","messageCount":2,"participants":["Hoda Salim","Pushkar Singh"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"534973","messageId":"CAAGT0iKRA++yUcCxyRLZN14jLV0xNVSXcKr=F5vJ48dXVEn6PQ@mail.gmail.com","threadId":"64900","inReplyTo":null,"subject":"Re: [PATCH] [GSoC][PATCH] t9160:modernize test path checking","fromName":"Hoda Salim","fromEmail":"hoda.s.salim@gmail.com","sentAt":"2026-02-02T13:36:04Z","receivedAt":"2026-02-02T13:36:19Z","isPatch":true,"sender":{"key":"hoda.s.salim@gmail.com","avatar":"https://avatars.githubusercontent.com/u/172552853?v=4"},"body":"Hi everyone,\n\nI'm Hoda, and I'm interested in contributing to Git through GSoC 2026.\nThis is my first patch to the project (my microproject), and I'd\nappreciate any feedback on it. The patch modernizes path checks in\nt9160 by replacing `test -f`, `test -d`, and `test -s` with Git's\ndedicated test helpers for better error messages and consistency. I'm\nhappy to make any changes if needed!\n\nThanks,\nHoda\n---\nReplace old-style path checks with Git's dedicated test helpers:\n- test -f → test_path_is_file\n- test -d → test_path_is_dir\n- test -s → test_file_not_empty\n\nFound using: git grep \"test -[efd]\" t/\n\nThis improves test readability and provides better error messages\nwhen path checks fail.\n\nSigned-off-by: HodaSalim <hoda.s.salim@gmail.com>\n---\n    [GSoC][PATCH] t9160:modernize test path checking\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2160%2FHodaSalim%2Fmicroproject%2Fmodernize-t9160-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git\npr-git-2160/HodaSalim/microproject/modernize-t9160-v1\nPull-Request: https://github.com/git/git/pull/2160\n\n t/t9160-git-svn-preserve-empty-dirs.sh | 22 +++++++++++-----------\n 1 file changed, 11 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t9160-git-svn-preserve-empty-dirs.sh\nb/t/t9160-git-svn-preserve-empty-dirs.sh\nindex 36c6b1a12f..b89c1cb93a 100755\n--- a/t/t9160-git-svn-preserve-empty-dirs.sh\n+++ b/t/t9160-git-svn-preserve-empty-dirs.sh\n@@ -61,15 +61,15 @@ test_expect_success 'clone svn repo with\n--preserve-empty-dirs' '\n\n # \"$GIT_REPO\"/1 should only contain the placeholder file.\n test_expect_success 'directory empty from inception' '\n- test -f \"$GIT_REPO\"/1/.gitignore &&\n+ test_path_is_file \"$GIT_REPO\"/1/.gitignore &&\n  test $(find \"$GIT_REPO\"/1 -type f | wc -l) = \"1\"\n '\n\n # \"$GIT_REPO\"/2 and \"$GIT_REPO\"/3 should only contain the placeholder file.\n test_expect_success 'directory empty from subsequent svn commit' '\n- test -f \"$GIT_REPO\"/2/.gitignore &&\n+ test_path_is_file \"$GIT_REPO\"/2/.gitignore &&\n  test $(find \"$GIT_REPO\"/2 -type f | wc -l) = \"1\" &&\n- test -f \"$GIT_REPO\"/3/.gitignore &&\n+ test_path_is_file \"$GIT_REPO\"/3/.gitignore &&\n  test $(find \"$GIT_REPO\"/3 -type f | wc -l) = \"1\"\n '\n\n@@ -77,7 +77,7 @@ test_expect_success 'directory empty from subsequent\nsvn commit' '\n # generated for every sub-directory at some point in the repo's history.\n test_expect_success 'add entry to previously empty directory' '\n  test $(find \"$GIT_REPO\"/4 -type f | wc -l) = \"1\" &&\n- test -f \"$GIT_REPO\"/4/a/b/c/foo\n+ test_path_is_file \"$GIT_REPO\"/4/a/b/c/foo\n '\n\n # The HEAD~2 commit should not have introduced .gitignore placeholder files.\n@@ -102,14 +102,14 @@ test_expect_success 'clone svn repo with\n--placeholder-file specified' '\n\n # \"$GIT_REPO\"/5/.placeholder should be a file, and non-empty.\n test_expect_success 'placeholder namespace conflict with file' '\n- test -s \"$GIT_REPO\"/5/.placeholder\n+ test_file_not_empty \"$GIT_REPO\"/5/.placeholder\n '\n\n # \"$GIT_REPO\"/6/.placeholder should be a directory, and the \"$GIT_REPO\"/6 tree\n # should only contain one file: the placeholder.\n test_expect_success 'placeholder namespace conflict with directory' '\n- test -d \"$GIT_REPO\"/6/.placeholder &&\n- test -f \"$GIT_REPO\"/6/.placeholder/.placeholder &&\n+ test_path_is_dir \"$GIT_REPO\"/6/.placeholder &&\n+ test_path_is_file \"$GIT_REPO\"/6/.placeholder/.placeholder &&\n  test $(find \"$GIT_REPO\"/6 -type f | wc -l) = \"1\"\n '\n\n@@ -134,18 +134,18 @@ test_expect_success 'second set of svn commits\nand rebase' '\n # Check that --preserve-empty-dirs and --placeholder-file flag state\n # stays persistent over multiple invocations.\n test_expect_success 'flag persistence during subsqeuent rebase' '\n- test -f \"$GIT_REPO\"/7/.placeholder &&\n+ test_path_is_file \"$GIT_REPO\"/7/.placeholder &&\n  test $(find \"$GIT_REPO\"/7 -type f | wc -l) = \"1\"\n '\n\n # Check that placeholder files are properly removed when unnecessary,\n # even across multiple invocations.\n test_expect_success 'placeholder list persistence during subsqeuent rebase' '\n- test -f \"$GIT_REPO\"/1/file1.txt &&\n+ test_path_is_file \"$GIT_REPO\"/1/file1.txt &&\n  test $(find \"$GIT_REPO\"/1 -type f | wc -l) = \"1\" &&\n\n- test -f \"$GIT_REPO\"/5/file1.txt &&\n- test -f \"$GIT_REPO\"/5/.placeholder &&\n+ test_path_is_file \"$GIT_REPO\"/5/file1.txt &&\n+ test_path_is_file \"$GIT_REPO\"/5/.placeholder &&\n  test $(find \"$GIT_REPO\"/5 -type f | wc -l) = \"2\"\n '\n\n\nbase-commit: 68cb7f9e92a5d8e9824f5b52ac3d0a9d8f653dbe\n"},{"id":"534974","messageId":"20260202134657.15320-1-pushkarkumarsingh1970@gmail.com","threadId":"64900","inReplyTo":"CAAGT0iKRA++yUcCxyRLZN14jLV0xNVSXcKr=F5vJ48dXVEn6PQ@mail.gmail.com","subject":"Re: [PATCH] [GSoC][PATCH] t9160: modernize test path checking","fromName":"Pushkar Singh","fromEmail":"pushkarkumarsingh1970@gmail.com","sentAt":"2026-02-02T13:46:57Z","receivedAt":"2026-02-02T13:47:03Z","isPatch":true,"sender":{"key":"pushkarkumarsingh1970@gmail.com","avatar":"https://avatars.githubusercontent.com/u/173247767?v=4"},"body":"Hi Hoda,\n\nWelcome!\n\nI took a quick look. The replacements with test_path_is_file, test_path_is_dir, and test_file_not_empty look appropriate here, and the patch itself seems straightforward.\n\nMinor nits:\n- I noticed \"subsqeuent\" is misspelled in a couple of the existing test descriptions (not introduced by this patch, but might be a nice follow-up cleanup).\n- You might also consider dropping the duplicated [PATCH] tag in the subject for cleanliness.\n\nOtherwise, this looks like a reasonable microproject.\n\nBest,\nPushkar\n"}]}