{"thread":{"id":"52978","subject":"[GSOC] [PATCH] replace test -f with test_path_is_file","startedAt":"2020-03-11T18:06:35Z","lastAt":"2020-03-11T19:29:36Z","messageCount":2,"participants":["Shubham Verma","Matheus Tavares Bernardino"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"393063","messageId":"20200311180625.4643-1-shubhunic@gmail.com","threadId":"52978","inReplyTo":null,"subject":"[GSOC] [PATCH] replace test -f with test_path_is_file","fromName":"Shubham Verma","fromEmail":"shubhunic@gmail.com","sentAt":"2020-03-11T18:06:25Z","receivedAt":"2020-03-11T18:06:35Z","isPatch":true,"sender":{"key":"shubhunic@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45103446?v=4"},"body":"Although `test -f` has the same functionality as test_path_is_file(), in the case where test_path_is_file() fails, we get much better\ndebugging information.\n\nReplace `test -f` with test_path_is_file() so that future developers will have a better experience debugging these test cases.\n---\n t/t9801-git-p4-branch.sh | 38 +++++++++++++++++++-------------------\n 1 file changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t9801-git-p4-branch.sh b/t/t9801-git-p4-branch.sh\nindex 67ff2711f5..214c2a183d 100755\n--- a/t/t9801-git-p4-branch.sh\n+++ b/t/t9801-git-p4-branch.sh\n@@ -200,19 +200,19 @@ test_expect_success 'git p4 clone simple branches' '\n \t\tgit p4 clone --dest=. --detect-branches //depot@all &&\n \t\tgit log --all --graph --decorate --stat &&\n \t\tgit reset --hard p4/depot/branch1 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n-\t\ttest -f file3 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n \t\tgrep update file2 &&\n \t\tgit reset --hard p4/depot/branch2 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n \t\ttest ! -f file3 &&\n \t\t! grep update file2 &&\n \t\tgit reset --hard p4/depot/branch3 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n-\t\ttest -f file3 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n \t\tgrep update file2 &&\n \t\tcd \"$cli\" &&\n \t\tcd branch1 &&\n@@ -603,22 +603,22 @@ test_expect_success 'git p4 clone simple branches with base folder on server sid\n \t\tgit p4 clone --dest=. --use-client-spec  --detect-branches //depot@all &&\n \t\tgit log --all --graph --decorate --stat &&\n \t\tgit reset --hard p4/depot/branch1 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n-\t\ttest -f file3 &&\n-\t\ttest -f sub_file1 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\ttest_path_is_file sub_file1 &&\n \t\tgrep update file2 &&\n \t\tgit reset --hard p4/depot/branch2 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n \t\ttest ! -f file3 &&\n-\t\ttest -f sub_file1 &&\n+\t\ttest_path_is_file sub_file1 &&\n \t\t! grep update file2 &&\n \t\tgit reset --hard p4/depot/branch3 &&\n-\t\ttest -f file1 &&\n-\t\ttest -f file2 &&\n-\t\ttest -f file3 &&\n-\t\ttest -f sub_file1 &&\n+\t\ttest_path_is_file file1 &&\n+\t\ttest_path_is_file file2 &&\n+\t\ttest_path_is_file file3 &&\n+\t\ttest_path_is_file sub_file1 &&\n \t\tgrep update file2 &&\n \t\tcd \"$cli\" &&\n \t\tcd branch1 &&\n-- \n2.17.1\n\n"},{"id":"393086","messageId":"CAHd-oW6K8Gh=un9znbNzm2rNvvL5s8j0uft8owNADkzjRL8jBg@mail.gmail.com","threadId":"52978","inReplyTo":"20200311180625.4643-1-shubhunic@gmail.com","subject":"Re: [GSOC] [PATCH] replace test -f with test_path_is_file","fromName":"Matheus Tavares Bernardino","fromEmail":"matheus.bernardino@usp.br","sentAt":"2020-03-11T19:29:22Z","receivedAt":"2020-03-11T19:29:36Z","isPatch":true,"sender":{"key":"matheus.tavb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701583?v=4"},"body":"Hi, Shubham. Welcome to the community!\n\nOn Wed, Mar 11, 2020 at 3:06 PM Shubham Verma <shubhunic@gmail.com> wrote:\n>\n> Subject: [GSOC] [PATCH] replace test -f with test_path_is_file\n\nIt's common to prefix the patch title with \"area: \", where \"area\"\ncorresponds to the codebase section which the patch is modifying. This\nmakes it easier to understand the scope of the change. You can check\nwhat others have been using for this specific file with `git log\n--no-merges t/t9801-git-p4-branch.sh`. In this case, I think a better\nalternative would be: \"t9801: replace test -f with test_path_is_file\"\n\n> Although `test -f` has the same functionality as test_path_is_file(), in the case where test_path_is_file() fails, we get much better\n> debugging information.\n>\n> Replace `test -f` with test_path_is_file() so that future developers will have a better experience debugging these test cases.\n\nIt's also a good practice to wrap the commit body in 72 columns. This\nwill, for example, help viewing the message in most terminals. And,\nplease, add your Signed-off-by[1] in the footer of the message.\n\n[1]: https://github.com/git/git/blob/master/Documentation/SubmittingPatches#L299\n\n> ---\n>  t/t9801-git-p4-branch.sh | 38 +++++++++++++++++++-------------------\n>  1 file changed, 19 insertions(+), 19 deletions(-)\n\nAs for the changes, LGTM :)\n"}]}