{"thread":{"id":"52653","subject":"[PATCH 0/3] t6025: updating tests","startedAt":"2020-01-16T20:36:37Z","lastAt":"2020-01-21T21:58:18Z","messageCount":24,"participants":["Shourya Shukla","Johannes Schindelin","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"389925","messageId":"20200116203622.4694-1-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":null,"subject":"[PATCH 0/3] t6025: updating tests","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-16T20:36:19Z","receivedAt":"2020-01-16T20:36:37Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Greetings everyone!\n\nThis is my first ever contribution in the Open-Source Community and I chose Git\nfor this purpose as I have been using this important tool to maintain my projects\nregularly.\n\nIn this patch, I have:\n\n  - modernized these tests so that they meet current Git CodingGuidlines[1]\n  - replaced the pipe operator with the redirection operator so that one can\n\tdetect the errors easily and precisely\n  - used helper function 'test_path_is_file()' to replace 'test -f' checks in\n\tin the program as it improves the readability of the code and provides \n\tbetter error messages\n\nAlso, I have some questions to better my understanding of the code:\n\t- In the statement, \n\t\t> git hash-object -t blob -w --stdin\n\t  is it necessary to explicitly specify the type 'blob' of the hash-object?\n\t  I have this question because it is the default type of hash-object.\n\t- In the statement, \n\t\t> l=$(printf file | git hash-object -t blob -w --stdin)\n\t  I have not used the redirection operator as this sub-shell will be executed \n\t  separately, hence its error cannot be captured therefore the presence of '>' \n\t  will not matter. Will using '>' improve the code?\n\nThanks,\nShourya Shukla\n\nShourya Shukla (3):\n  t6025: modernize style\n  t6025: replace pipe with redirection operator\n  t6025: use helpers to replace test -f <path>\n\n t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n 1 file changed, 50 insertions(+), 47 deletions(-)\n\n-- \n2.20.1\n"},{"id":"389926","messageId":"20200116203622.4694-2-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200116203622.4694-1-shouryashukla.oo@gmail.com","subject":"[PATCH 1/3] t6025: modernize style","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-16T20:36:20Z","receivedAt":"2020-01-16T20:36:40Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\nhas a lot of style violations, including the mixed-use of tabs and spaces,\nmissing indentations, and other shell script style violations. Update it to\nmatch the CodingGuidelines.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n 1 file changed, 50 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 433c4de08f..b9219af659 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -10,52 +10,55 @@ if core.symlinks is false.'\n \n . ./test-lib.sh\n \n-test_expect_success \\\n-'setup' '\n-git config core.symlinks false &&\n-> file &&\n-git add file &&\n-git commit -m initial &&\n-git branch b-symlink &&\n-git branch b-file &&\n-l=$(printf file | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m master &&\n-git checkout b-symlink &&\n-l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m b-symlink &&\n-git checkout b-file &&\n-echo plain-file > symlink &&\n-git add symlink &&\n-git commit -m b-file'\n-\n-test_expect_success \\\n-'merge master into b-symlink, which has a different symbolic link' '\n-git checkout b-symlink &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge master into b-file, which has a file instead of a symbolic link' '\n-git reset --hard && git checkout b-file &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge b-file, which has a file instead of a symbolic link, into master' '\n-git reset --hard &&\n-git checkout master &&\n-test_must_fail git merge b-file'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n+test_expect_success 'setup' '\n+\tgit config core.symlinks false &&\n+\ttouch file &&\n+\tgit add file &&\n+\tgit commit -m initial &&\n+\tgit branch b-symlink &&\n+\tgit branch b-file &&\n+\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m master &&\n+\tgit checkout b-symlink &&\n+\tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m b-symlink &&\n+\tgit checkout b-file &&\n+\techo plain-file >symlink &&\n+\tgit add symlink &&\n+\tgit commit -m b-file\n+'\n+\n+test_expect_success 'merge master into b-symlink, which has a different symbolic link' '\n+\tgit checkout b-symlink &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n+\tgit reset --hard &&\n+\tgit checkout b-file &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\ttest_must_fail git merge b-file\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n \n test_done\n-- \n2.20.1\n\n"},{"id":"389927","messageId":"20200116203622.4694-3-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200116203622.4694-1-shouryashukla.oo@gmail.com","subject":"[PATCH 2/3] t6025: replace pipe with redirection operator","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-16T20:36:21Z","receivedAt":"2020-01-16T20:36:42Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The exit code of pipes(|) are always ignored, which will create\nerrors in subsequent statements. Let's handle it by redirecting\nits output to a file and capturing return values. Replace pipe\nwith redirect(>) operator.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex b9219af659..41bae56ea9 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -18,13 +18,13 @@ test_expect_success 'setup' '\n \tgit branch b-symlink &&\n \tgit branch b-file &&\n \tl=$(printf file | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\techo \"120000 $l\tsymlink\" >foo &&\n+\tgit update-index --index-info <foo &&\n \tgit commit -m master &&\n \tgit checkout b-symlink &&\n \tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\techo \"120000 $l\tsymlink\" >foo &&\n+\tgit update-index --index-info <foo &&\n \tgit commit -m b-symlink &&\n \tgit checkout b-file &&\n \techo plain-file >symlink &&\n-- \n2.20.1\n\n"},{"id":"389928","messageId":"20200116203622.4694-4-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200116203622.4694-1-shouryashukla.oo@gmail.com","subject":"[PATCH 3/3] t6025: use helpers to replace test -f <path>","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-16T20:36:22Z","receivedAt":"2020-01-16T20:36:45Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Take advantage of helper function 'test_path_is_file()' to\nreplace 'test -f' since the function makes the code more\nreadable and gives better error messages.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 41bae56ea9..ebbbc03f1d 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -38,7 +38,7 @@ test_expect_success 'merge master into b-symlink, which has a different symbolic\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n@@ -48,7 +48,7 @@ test_expect_success 'merge master into b-file, which has a file instead of a sym\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n@@ -58,7 +58,7 @@ test_expect_success 'merge b-file, which has a file instead of a symbolic link,\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_done\n-- \n2.20.1\n\n"},{"id":"389939","messageId":"nycvar.QRO.7.76.6.2001162239400.46@tvgsbejvaqbjf.bet","threadId":"52653","inReplyTo":"20200116203622.4694-2-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 1/3] t6025: modernize style","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-16T21:42:04Z","receivedAt":"2020-01-16T21:42:15Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 17 Jan 2020, Shourya Shukla wrote:\n\n> The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\n> has a lot of style violations, including the mixed-use of tabs and spaces,\n> missing indentations, and other shell script style violations. Update it to\n> match the CodingGuidelines.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n\nSounds good. Just one nit:\n\n>  t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n>  1 file changed, 50 insertions(+), 47 deletions(-)\n>\n> diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\n> index 433c4de08f..b9219af659 100755\n> --- a/t/t6025-merge-symlinks.sh\n> +++ b/t/t6025-merge-symlinks.sh\n> @@ -10,52 +10,55 @@ if core.symlinks is false.'\n>\n>  . ./test-lib.sh\n>\n> -test_expect_success \\\n> -'setup' '\n> -git config core.symlinks false &&\n> -> file &&\n\nHere, `file` is written as a 0-byte file, and...\n\n> -git add file &&\n> -git commit -m initial &&\n> -git branch b-symlink &&\n> -git branch b-file &&\n> -l=$(printf file | git hash-object -t blob -w --stdin) &&\n> -echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n> -git commit -m master &&\n> -git checkout b-symlink &&\n> -l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n> -echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n> -git commit -m b-symlink &&\n> -git checkout b-file &&\n> -echo plain-file > symlink &&\n> -git add symlink &&\n> -git commit -m b-file'\n> -\n> -test_expect_success \\\n> -'merge master into b-symlink, which has a different symbolic link' '\n> -git checkout b-symlink &&\n> -test_must_fail git merge master'\n> -\n> -test_expect_success \\\n> -'the merge result must be a file' '\n> -test -f symlink'\n> -\n> -test_expect_success \\\n> -'merge master into b-file, which has a file instead of a symbolic link' '\n> -git reset --hard && git checkout b-file &&\n> -test_must_fail git merge master'\n> -\n> -test_expect_success \\\n> -'the merge result must be a file' '\n> -test -f symlink'\n> -\n> -test_expect_success \\\n> -'merge b-file, which has a file instead of a symbolic link, into master' '\n> -git reset --hard &&\n> -git checkout master &&\n> -test_must_fail git merge b-file'\n> -\n> -test_expect_success \\\n> -'the merge result must be a file' '\n> -test -f symlink'\n> +test_expect_success 'setup' '\n> +\tgit config core.symlinks false &&\n> +\ttouch file &&\n\n... here we now use `touch` instead. We do prefer `>file` in this\ninstance, though, I think. At least we do not prohibit it.\n\nOtherwise it looks very good!\nJohannes\n\n> +\tgit add file &&\n> +\tgit commit -m initial &&\n> +\tgit branch b-symlink &&\n> +\tgit branch b-file &&\n> +\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n> +\techo \"120000 $l\tsymlink\" |\n> +\tgit update-index --index-info &&\n> +\tgit commit -m master &&\n> +\tgit checkout b-symlink &&\n> +\tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n> +\techo \"120000 $l\tsymlink\" |\n> +\tgit update-index --index-info &&\n> +\tgit commit -m b-symlink &&\n> +\tgit checkout b-file &&\n> +\techo plain-file >symlink &&\n> +\tgit add symlink &&\n> +\tgit commit -m b-file\n> +'\n> +\n> +test_expect_success 'merge master into b-symlink, which has a different symbolic link' '\n> +\tgit checkout b-symlink &&\n> +\ttest_must_fail git merge master\n> +'\n> +\n> +test_expect_success 'the merge result must be a file' '\n> +\ttest -f symlink\n> +'\n> +\n> +test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n> +\tgit reset --hard &&\n> +\tgit checkout b-file &&\n> +\ttest_must_fail git merge master\n> +'\n> +\n> +test_expect_success 'the merge result must be a file' '\n> +\ttest -f symlink\n> +'\n> +\n> +test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n> +\tgit reset --hard &&\n> +\tgit checkout master &&\n> +\ttest_must_fail git merge b-file\n> +'\n> +\n> +test_expect_success 'the merge result must be a file' '\n> +\ttest -f symlink\n> +'\n>\n>  test_done\n> --\n> 2.20.1\n>\n>\n"},{"id":"389941","messageId":"nycvar.QRO.7.76.6.2001162243100.46@tvgsbejvaqbjf.bet","threadId":"52653","inReplyTo":"20200116203622.4694-1-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 0/3] t6025: updating tests","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2020-01-16T21:46:36Z","receivedAt":"2020-01-16T21:46:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 17 Jan 2020, Shourya Shukla wrote:\n\n> Greetings everyone!\n>\n> This is my first ever contribution in the Open-Source Community and I chose Git\n> for this purpose as I have been using this important tool to maintain my projects\n> regularly.\n>\n> In this patch, I have:\n>\n>   - modernized these tests so that they meet current Git CodingGuidlines[1]\n>   - replaced the pipe operator with the redirection operator so that one can\n> \tdetect the errors easily and precisely\n>   - used helper function 'test_path_is_file()' to replace 'test -f' checks in\n> \tin the program as it improves the readability of the code and provides\n> \tbetter error messages\n>\n> Also, I have some questions to better my understanding of the code:\n> \t- In the statement,\n> \t\t> git hash-object -t blob -w --stdin\n> \t  is it necessary to explicitly specify the type 'blob' of the hash-object?\n> \t  I have this question because it is the default type of hash-object.\n\nIt is the default type, but:\n\n1) the code is not broken, so why fix it?\n\n2) it _might_ be possible that the default changes, or can be configured\n   in the future. The original author might just have wanted to stay safe.\n\n> \t- In the statement,\n> \t\t> l=$(printf file | git hash-object -t blob -w --stdin)\n> \t  I have not used the redirection operator as this sub-shell will be executed\n> \t  separately, hence its error cannot be captured therefore the presence of '>'\n> \t  will not matter. Will using '>' improve the code?\n\nIt will be enhanced, though:\n\n\tprintf file >file &&\n\tl=$(git hash-object -t blob -w --stdin)\n\nwill have a non-zero exit code if the `hash_object` call fails.\n\n>\n> Thanks,\n> Shourya Shukla\n>\n> Shourya Shukla (3):\n>   t6025: modernize style\n>   t6025: replace pipe with redirection operator\n>   t6025: use helpers to replace test -f <path>\n\nApart from one little issue in the first patch, this all looks very good\nto me.\n\nThanks,\nJohannes\n\n>\n>  t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n>  1 file changed, 50 insertions(+), 47 deletions(-)\n>\n> --\n> 2.20.1\n>\n"},{"id":"389952","messageId":"xmqqftgff1r0.fsf@gitster-ct.c.googlers.com","threadId":"52653","inReplyTo":"20200116203622.4694-3-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 2/3] t6025: replace pipe with redirection operator","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-16T22:57:39Z","receivedAt":"2020-01-16T22:57:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> -\techo \"120000 $l\tsymlink\" |\n> -\tgit update-index --index-info &&\n> +\techo \"120000 $l\tsymlink\" >foo &&\n> +\tgit update-index --index-info <foo &&\n\nIf we had \"git\" on the left-hand-side (i.e. upstream) of a pipe, it\nwould make sense to split the pipeline like this, but this (and the\nother one this patch touches) is on the right side, whose exit\nstatus is not lost.  And we are not in the business of preparing for\nbroken implementation of \"echo\".\n\nSo this rewrite is unnecessary and unwarranted.\n\nBy the way, I think the pipeline\n\n\techo ... | git update-index --index-info &&\n\nshould be written on a single line in the previous step 1/3.\n\n>  \tgit commit -m master &&\n>  \tgit checkout b-symlink &&\n>  \tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n> -\techo \"120000 $l\tsymlink\" |\n> -\tgit update-index --index-info &&\n> +\techo \"120000 $l\tsymlink\" >foo &&\n> +\tgit update-index --index-info <foo &&\n>  \tgit commit -m b-symlink &&\n>  \tgit checkout b-file &&\n>  \techo plain-file >symlink &&\n"},{"id":"389953","messageId":"xmqqblr3f1q3.fsf@gitster-ct.c.googlers.com","threadId":"52653","inReplyTo":"20200116203622.4694-4-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 3/3] t6025: use helpers to replace test -f <path>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-16T22:58:12Z","receivedAt":"2020-01-16T22:58:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> Take advantage of helper function 'test_path_is_file()' to\n> replace 'test -f' since the function makes the code more\n> readable and gives better error messages.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n>  t/t6025-merge-symlinks.sh | 6 +++---\n>  1 file changed, 3 insertions(+), 3 deletions(-)\n\nMakes sense.\n\n> diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\n> index 41bae56ea9..ebbbc03f1d 100755\n> --- a/t/t6025-merge-symlinks.sh\n> +++ b/t/t6025-merge-symlinks.sh\n> @@ -38,7 +38,7 @@ test_expect_success 'merge master into b-symlink, which has a different symbolic\n>  '\n>  \n>  test_expect_success 'the merge result must be a file' '\n> -\ttest -f symlink\n> +\ttest_path_is_file symlink\n>  '\n>  \n>  test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n> @@ -48,7 +48,7 @@ test_expect_success 'merge master into b-file, which has a file instead of a sym\n>  '\n>  \n>  test_expect_success 'the merge result must be a file' '\n> -\ttest -f symlink\n> +\ttest_path_is_file symlink\n>  '\n>  \n>  test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n> @@ -58,7 +58,7 @@ test_expect_success 'merge b-file, which has a file instead of a symbolic link,\n>  '\n>  \n>  test_expect_success 'the merge result must be a file' '\n> -\ttest -f symlink\n> +\ttest_path_is_file symlink\n>  '\n>  \n>  test_done\n"},{"id":"390014","messageId":"20200117204426.9347-1-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"xmqqblr3f1q3.fsf@gitster-ct.c.googlers.com","subject":"[PATCH 0/3] t6025: amended changes after suggestions from the community","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-17T20:44:23Z","receivedAt":"2020-01-17T20:44:52Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Greetings everyone!\n\nI have made the changes in my patch on the advise of Junio C Hamano and \nJohannes Schindelin. Thank you for looking into my changes, this has given\nme confidence to contribute more in the Git Community.\n\nThank you,\nShourya Shukla\n\nShourya Shukla (3):\n  t6025: modernize style\n  t6025: replace pipe with redirection operator\n  t6025: use helpers to replace test -f <path>\n\n t/t6025-merge-symlinks.sh | 96 ++++++++++++++++++++-------------------\n 1 file changed, 49 insertions(+), 47 deletions(-)\n\n-- \n2.20.1\n\n"},{"id":"390015","messageId":"20200117204426.9347-2-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200117204426.9347-1-shouryashukla.oo@gmail.com","subject":"[PATCH 1/3] t6025: modernize style","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-17T20:44:24Z","receivedAt":"2020-01-17T20:44:55Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\nhas a lot of style violations, including the mixed-use of tabs and spaces,\nmissing indentations, and other shell script style violations. Update it to\nmatch the CodingGuidelines.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n 1 file changed, 50 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 433c4de08f..7a19ba8520 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -10,52 +10,55 @@ if core.symlinks is false.'\n \n . ./test-lib.sh\n \n-test_expect_success \\\n-'setup' '\n-git config core.symlinks false &&\n-> file &&\n-git add file &&\n-git commit -m initial &&\n-git branch b-symlink &&\n-git branch b-file &&\n-l=$(printf file | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m master &&\n-git checkout b-symlink &&\n-l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m b-symlink &&\n-git checkout b-file &&\n-echo plain-file > symlink &&\n-git add symlink &&\n-git commit -m b-file'\n-\n-test_expect_success \\\n-'merge master into b-symlink, which has a different symbolic link' '\n-git checkout b-symlink &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge master into b-file, which has a file instead of a symbolic link' '\n-git reset --hard && git checkout b-file &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge b-file, which has a file instead of a symbolic link, into master' '\n-git reset --hard &&\n-git checkout master &&\n-test_must_fail git merge b-file'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n+test_expect_success 'setup' '\n+\tgit config core.symlinks false &&\n+\t>file &&\n+\tgit add file &&\n+\tgit commit -m initial &&\n+\tgit branch b-symlink &&\n+\tgit branch b-file &&\n+\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m master &&\n+\tgit checkout b-symlink &&\n+\tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m b-symlink &&\n+\tgit checkout b-file &&\n+\techo plain-file >symlink &&\n+\tgit add symlink &&\n+\tgit commit -m b-file\n+'\n+\n+test_expect_success 'merge master into b-symlink, which has a different symbolic link' '\n+\tgit checkout b-symlink &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n+\tgit reset --hard &&\n+\tgit checkout b-file &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\ttest_must_fail git merge b-file\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390016","messageId":"20200117204426.9347-3-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200117204426.9347-1-shouryashukla.oo@gmail.com","subject":"[PATCH 2/3] t6025: replace pipe with redirection operator","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-17T20:44:25Z","receivedAt":"2020-01-17T20:44:58Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The exit code of pipes(|) are always ignored, which will create\nerrors in subsequent statements. Let's handle it by redirecting\nits output to a file and capturing return values. Replace pipe\nwith redirect(>) operator.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 9 ++++-----\n 1 file changed, 4 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 7a19ba8520..5136bf1e13 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -17,14 +17,13 @@ test_expect_success 'setup' '\n \tgit commit -m initial &&\n \tgit branch b-symlink &&\n \tgit branch b-file &&\n-\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\tprintf file >file &&\n+\tl=$(git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" | git update-index --index-info &&\n \tgit commit -m master &&\n \tgit checkout b-symlink &&\n \tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\techo \"120000 $l\tsymlink\" | git update-index --index-info &&\n \tgit commit -m b-symlink &&\n \tgit checkout b-file &&\n \techo plain-file >symlink &&\n-- \n2.20.1\n\n"},{"id":"390017","messageId":"20200117204426.9347-4-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200117204426.9347-1-shouryashukla.oo@gmail.com","subject":"[PATCH 3/3] t6025: use helpers to replace test -f <path>","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-17T20:44:26Z","receivedAt":"2020-01-17T20:45:01Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Take advantage of helper function 'test_path_is_file()' to\nreplace 'test -f' since the function makes the code more\nreadable and gives better error messages.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 5136bf1e13..18a204bb65 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -37,7 +37,7 @@ test_expect_success 'merge master into b-symlink, which has a different symbolic\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n@@ -47,7 +47,7 @@ test_expect_success 'merge master into b-file, which has a file instead of a sym\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n@@ -57,7 +57,7 @@ test_expect_success 'merge b-file, which has a file instead of a symbolic link,\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390020","messageId":"CAPig+cTW4hATiMYVE7kzcLqK3do9=K8X0nmYjWLOhabgOxZ-XA@mail.gmail.com","threadId":"52653","inReplyTo":"20200117204426.9347-2-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 1/3] t6025: modernize style","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-01-17T21:15:12Z","receivedAt":"2020-01-17T21:15:26Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jan 17, 2020 at 3:45 PM Shourya Shukla\n<shouryashukla.oo@gmail.com> wrote:\n> [PATCH 1/3] t6025: modernize style\n\nWhen sending a new version of a patch series, indicate this via\n\"[PATCH v2 1/3]\", for instance. The -v option of \"git format-patch\"\ncan help automate this for you.\n\n> The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\n> has a lot of style violations, including the mixed-use of tabs and spaces,\n> missing indentations, and other shell script style violations. Update it to\n> match the CodingGuidelines.\n>\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n> diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\n> @@ -10,52 +10,55 @@ if core.symlinks is false.'\n> +test_expect_success 'setup' '\n> +       git config core.symlinks false &&\n> +       >file &&\n> +       git add file &&\n> +       git commit -m initial &&\n> +       git branch b-symlink &&\n> +       git branch b-file &&\n> +       l=$(printf file | git hash-object -t blob -w --stdin) &&\n> +       echo \"120000 $l symlink\" |\n> +       git update-index --index-info &&\n\nAs mentioned[1] in the review of v1, this should be written:\n\n    echo \"120000 $l symlink\" | git update-index --index-info &&\n\n[1]: https://lore.kernel.org/git/xmqqftgff1r0.fsf@gitster-ct.c.googlers.com/\n\n> +       git commit -m master &&\n> +       git checkout b-symlink &&\n> +       l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n> +       echo \"120000 $l symlink\" |\n> +       git update-index --index-info &&\n> +       git commit -m b-symlink &&\n> +       git checkout b-file &&\n> +       echo plain-file >symlink &&\n> +       git add symlink &&\n> +       git commit -m b-file\n> +'\n"},{"id":"390023","messageId":"CAPig+cQX=jB1KTKcOMVE9u0jX-ZXt_vQBndkzqqQWORu5iFxeA@mail.gmail.com","threadId":"52653","inReplyTo":"20200117204426.9347-3-shouryashukla.oo@gmail.com","subject":"Re: [PATCH 2/3] t6025: replace pipe with redirection operator","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2020-01-17T21:24:36Z","receivedAt":"2020-01-17T21:24:50Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Fri, Jan 17, 2020 at 3:45 PM Shourya Shukla\n<shouryashukla.oo@gmail.com> wrote:\n> The exit code of pipes(|) are always ignored, which will create\n> errors in subsequent statements. Let's handle it by redirecting\n> its output to a file and capturing return values. Replace pipe\n> with redirect(>) operator.\n\nThis is not an accurate description. The proper way to explain this is\nthat exit code of a command upstream of a pipe is lost; the exit code\nof a command downstream is not lost. We don't want to lose the exit\ncode of a git command, so a git command should not be upstream. (We\ndon't care about non-git commands being upstream when that command's\nexit code is not relevant.)\n\n> Signed-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n> ---\n> diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\n> @@ -17,14 +17,13 @@ test_expect_success 'setup' '\n>         git commit -m initial &&\n>         git branch b-symlink &&\n>         git branch b-file &&\n> -       l=$(printf file | git hash-object -t blob -w --stdin) &&\n\nThis command is fine as-is. We are interested in the exit code of the\ngit command (which is correctly downstream), and we don't care about\nthe exit code of 'printf' (which is upstream), so there is no reason\nto rewrite this to use temporary files instead.\n\n> +       printf file >file &&\n> +       l=$(git hash-object -t blob -w --stdin) &&\n\nSorry, but this just doesn't make sense. You're telling \"git\nhash-object\" to take its input from the standard input stream, yet you\ndon't feed anything to it on that stream. If anything, it should have\nbeen written like this:\n\n     l=$(git hash-object -t blob -w --stdin <file) &&\n\nhowever, as noted above, there is no reason to avoid pipes in this\ncase, so this rewrite is unnecessary.\n\nBy the way, it's hard to imagine that this test passed once this\nchange was made (and, if it did pass, then that would likely indicate\nthat the test is somehow flawed.)\n"},{"id":"390025","messageId":"xmqqk15pdb7q.fsf@gitster-ct.c.googlers.com","threadId":"52653","inReplyTo":"CAPig+cTW4hATiMYVE7kzcLqK3do9=K8X0nmYjWLOhabgOxZ-XA@mail.gmail.com","subject":"Re: [PATCH 1/3] t6025: modernize style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-17T21:28:25Z","receivedAt":"2020-01-17T21:28:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n>> +       l=$(printf file | git hash-object -t blob -w --stdin) &&\n>> +       echo \"120000 $l symlink\" |\n>> +       git update-index --index-info &&\n>\n> As mentioned[1] in the review of v1, this should be written:\n>\n>     echo \"120000 $l symlink\" | git update-index --index-info &&\n>\n> [1]: https://lore.kernel.org/git/xmqqftgff1r0.fsf@gitster-ct.c.googlers.com/\n>\n>> +       git commit -m master &&\n>> +       git checkout b-symlink &&\n>> +       l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n>> +       echo \"120000 $l symlink\" |\n>> +       git update-index --index-info &&\n\nSame here.  Funnily, 2/3 improves on this, but I agree that we\nshould get it right from the get-go.\n\n>> +       git commit -m b-symlink &&\n>> +       git checkout b-file &&\n>> +       echo plain-file >symlink &&\n>> +       git add symlink &&\n>> +       git commit -m b-file\n>> +'\n"},{"id":"390037","messageId":"20200118083326.9643-1-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"CAPig+cQX=jB1KTKcOMVE9u0jX-ZXt_vQBndkzqqQWORu5iFxeA@mail.gmail.com","subject":"[PATCH 0/3] t6025: updating tests","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:20Z","receivedAt":"2020-01-18T08:33:36Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Greetings everyone!\n\nThis is my first ever contribution in the Open-Source Community and I chose Git\nfor this purpose as I have been using this important tool to maintain my projects\nregularly.\n\nIn this patch, I have:\n\n  - modernized these tests so that they meet current Git CodingGuidlines[1]\n  - replaced the pipe operator with the redirection operator so that one can\n\tdetect the errors easily and precisely\n  - used helper function 'test_path_is_file()' to replace 'test -f' checks in\n\tin the program as it improves the readability of the code and provides \n\tbetter error messages\n\nAlso, I have some questions to better my understanding of the code:\n\t- In the statement, \n\t\t> git hash-object -t blob -w --stdin\n\t  is it necessary to explicitly specify the type 'blob' of the hash-object?\n\t  I have this question because it is the default type of hash-object.\n\t- In the statement, \n\t\t> l=$(printf file | git hash-object -t blob -w --stdin)\n\t  I have not used the redirection operator as this sub-shell will be executed \n\t  separately, hence its error cannot be captured therefore the presence of '>' \n\t  will not matter. Will using '>' improve the code?\n\nThanks,\nShourya Shukla\n\nShourya Shukla (3):\n  t6025: modernize style\n  t6025: replace pipe with redirection operator\n  t6025: use helpers to replace test -f <path>\n\n t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n 1 file changed, 50 insertions(+), 47 deletions(-)\n\n-- \n2.20.1\n"},{"id":"390038","messageId":"20200118083326.9643-2-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH 1/3] t6025: modernize style","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:21Z","receivedAt":"2020-01-18T08:33:38Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\nhas a lot of style violations, including the mixed-use of tabs and spaces,\nmissing indentations, and other shell script style violations. Update it to\nmatch the CodingGuidelines.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 97 ++++++++++++++++++++-------------------\n 1 file changed, 50 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 433c4de08f..b9219af659 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -10,52 +10,55 @@ if core.symlinks is false.'\n \n . ./test-lib.sh\n \n-test_expect_success \\\n-'setup' '\n-git config core.symlinks false &&\n-> file &&\n-git add file &&\n-git commit -m initial &&\n-git branch b-symlink &&\n-git branch b-file &&\n-l=$(printf file | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m master &&\n-git checkout b-symlink &&\n-l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m b-symlink &&\n-git checkout b-file &&\n-echo plain-file > symlink &&\n-git add symlink &&\n-git commit -m b-file'\n-\n-test_expect_success \\\n-'merge master into b-symlink, which has a different symbolic link' '\n-git checkout b-symlink &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge master into b-file, which has a file instead of a symbolic link' '\n-git reset --hard && git checkout b-file &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge b-file, which has a file instead of a symbolic link, into master' '\n-git reset --hard &&\n-git checkout master &&\n-test_must_fail git merge b-file'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n+test_expect_success 'setup' '\n+\tgit config core.symlinks false &&\n+\ttouch file &&\n+\tgit add file &&\n+\tgit commit -m initial &&\n+\tgit branch b-symlink &&\n+\tgit branch b-file &&\n+\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m master &&\n+\tgit checkout b-symlink &&\n+\tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" |\n+\tgit update-index --index-info &&\n+\tgit commit -m b-symlink &&\n+\tgit checkout b-file &&\n+\techo plain-file >symlink &&\n+\tgit add symlink &&\n+\tgit commit -m b-file\n+'\n+\n+test_expect_success 'merge master into b-symlink, which has a different symbolic link' '\n+\tgit checkout b-symlink &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n+\tgit reset --hard &&\n+\tgit checkout b-file &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\ttest_must_fail git merge b-file\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390039","messageId":"20200118083326.9643-3-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH 2/3] t6025: replace pipe with redirection operator","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:22Z","receivedAt":"2020-01-18T08:33:42Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The exit code of pipes(|) are always ignored, which will create\nerrors in subsequent statements. Let's handle it by redirecting\nits output to a file and capturing return values. Replace pipe\nwith redirect(>) operator.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex b9219af659..41bae56ea9 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -18,13 +18,13 @@ test_expect_success 'setup' '\n \tgit branch b-symlink &&\n \tgit branch b-file &&\n \tl=$(printf file | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\techo \"120000 $l\tsymlink\" >foo &&\n+\tgit update-index --index-info <foo &&\n \tgit commit -m master &&\n \tgit checkout b-symlink &&\n \tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-\techo \"120000 $l\tsymlink\" |\n-\tgit update-index --index-info &&\n+\techo \"120000 $l\tsymlink\" >foo &&\n+\tgit update-index --index-info <foo &&\n \tgit commit -m b-symlink &&\n \tgit checkout b-file &&\n \techo plain-file >symlink &&\n-- \n2.20.1\n\n"},{"id":"390040","messageId":"20200118083326.9643-4-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH 3/3] t6025: use helpers to replace test -f <path>","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:23Z","receivedAt":"2020-01-18T08:33:45Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Take advantage of helper function 'test_path_is_file()' to\nreplace 'test -f' since the function makes the code more\nreadable and gives better error messages.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 41bae56ea9..ebbbc03f1d 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -38,7 +38,7 @@ test_expect_success 'merge master into b-symlink, which has a different symbolic\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n@@ -48,7 +48,7 @@ test_expect_success 'merge master into b-file, which has a file instead of a sym\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n@@ -58,7 +58,7 @@ test_expect_success 'merge b-file, which has a file instead of a symbolic link,\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390041","messageId":"20200118083326.9643-5-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 0/2] t025: amended changes after suggestions from the community","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:24Z","receivedAt":"2020-01-18T08:33:48Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Greetings everyone!\n\nAfter some advise from Eric Sunshine, I have removed the commit to replace pipes\nwith redirection operators. Also, as Junio Habano and Eric Sunshine pointed out,\nI made a small mistake while committing changes in my first commit and it has been\ncorrected as well.\n\nThanks,\nShourya Shukla\n\nShourya Shukla (2):\n  t6025: modernize style\n  t6025: use helpers to replace test -f <path>\n\n t/t6025-merge-symlinks.sh | 95 ++++++++++++++++++++-------------------\n 1 file changed, 48 insertions(+), 47 deletions(-)\n\n-- \n2.20.1\n\n"},{"id":"390042","messageId":"20200118083326.9643-6-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 1/2] t6025: modernize style","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:25Z","receivedAt":"2020-01-18T08:33:51Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\nhas a lot of style violations, including the mixed-use of tabs and spaces,\nmissing indentations, and other shell script style violations. Update it to\nmatch the CodingGuidelines.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 95 ++++++++++++++++++++-------------------\n 1 file changed, 48 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex 433c4de08f..d257dcf34d 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -10,52 +10,53 @@ if core.symlinks is false.'\n \n . ./test-lib.sh\n \n-test_expect_success \\\n-'setup' '\n-git config core.symlinks false &&\n-> file &&\n-git add file &&\n-git commit -m initial &&\n-git branch b-symlink &&\n-git branch b-file &&\n-l=$(printf file | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m master &&\n-git checkout b-symlink &&\n-l=$(printf file-different | git hash-object -t blob -w --stdin) &&\n-echo \"120000 $l\tsymlink\" | git update-index --index-info &&\n-git commit -m b-symlink &&\n-git checkout b-file &&\n-echo plain-file > symlink &&\n-git add symlink &&\n-git commit -m b-file'\n-\n-test_expect_success \\\n-'merge master into b-symlink, which has a different symbolic link' '\n-git checkout b-symlink &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge master into b-file, which has a file instead of a symbolic link' '\n-git reset --hard && git checkout b-file &&\n-test_must_fail git merge master'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n-\n-test_expect_success \\\n-'merge b-file, which has a file instead of a symbolic link, into master' '\n-git reset --hard &&\n-git checkout master &&\n-test_must_fail git merge b-file'\n-\n-test_expect_success \\\n-'the merge result must be a file' '\n-test -f symlink'\n+test_expect_success 'setup' '\n+\tgit config core.symlinks false &&\n+\t>file &&\n+\tgit add file &&\n+\tgit commit -m initial &&\n+\tgit branch b-symlink &&\n+\tgit branch b-file &&\n+\tl=$(printf file | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" | git update-index --index-info &&\n+\tgit commit -m master &&\n+\tgit checkout b-symlink &&\n+\tl=$(printf file-different | git hash-object -t blob -w --stdin) &&\n+\techo \"120000 $l\tsymlink\" | git update-index --index-info &&\n+\tgit commit -m b-symlink &&\n+\tgit checkout b-file &&\n+\techo plain-file >symlink &&\n+\tgit add symlink &&\n+\tgit commit -m b-file\n+'\n+\n+test_expect_success 'merge master into b-symlink, which has a different symbolic link' '\n+\tgit checkout b-symlink &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n+\tgit reset --hard &&\n+\tgit checkout b-file &&\n+\ttest_must_fail git merge master\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n+\n+test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n+\tgit reset --hard &&\n+\tgit checkout master &&\n+\ttest_must_fail git merge b-file\n+'\n+\n+test_expect_success 'the merge result must be a file' '\n+\ttest -f symlink\n+'\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390043","messageId":"20200118083326.9643-7-shouryashukla.oo@gmail.com","threadId":"52653","inReplyTo":"20200118083326.9643-1-shouryashukla.oo@gmail.com","subject":"[PATCH v3 2/2] t6025: use helpers to replace test -f <path>","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-01-18T08:33:26Z","receivedAt":"2020-01-18T08:33:54Z","isPatch":true,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Take advantage of helper function 'test_path_is_file()' to\nreplace 'test -f' since the function makes the code more\nreadable and gives better error messages.\n\nSigned-off-by: Shourya Shukla <shouryashukla.oo@gmail.com>\n---\n t/t6025-merge-symlinks.sh | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh\nindex d257dcf34d..6c0a90d044 100755\n--- a/t/t6025-merge-symlinks.sh\n+++ b/t/t6025-merge-symlinks.sh\n@@ -36,7 +36,7 @@ test_expect_success 'merge master into b-symlink, which has a different symbolic\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '\n@@ -46,7 +46,7 @@ test_expect_success 'merge master into b-file, which has a file instead of a sym\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '\n@@ -56,7 +56,7 @@ test_expect_success 'merge b-file, which has a file instead of a symbolic link,\n '\n \n test_expect_success 'the merge result must be a file' '\n-\ttest -f symlink\n+\ttest_path_is_file symlink\n '\n \n test_done\n-- \n2.20.1\n\n"},{"id":"390204","messageId":"xmqqy2u08obx.fsf@gitster-ct.c.googlers.com","threadId":"52653","inReplyTo":"20200118083326.9643-6-shouryashukla.oo@gmail.com","subject":"Re: [PATCH v3 1/2] t6025: modernize style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-21T21:57:38Z","receivedAt":"2020-01-21T21:57:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> The tests in `t6025-merge-symlinks.sh` were written a long time ago, and\n> has a lot of style violations, including the mixed-use of tabs and spaces,\n> missing indentations, and other shell script style violations. Update it to\n> match the CodingGuidelines.\n\nLooks good.  Will queue.\n\nThanks.\n"},{"id":"390205","messageId":"xmqqtv4o8ob0.fsf@gitster-ct.c.googlers.com","threadId":"52653","inReplyTo":"20200118083326.9643-7-shouryashukla.oo@gmail.com","subject":"Re: [PATCH v3 2/2] t6025: use helpers to replace test -f <path>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-01-21T21:58:11Z","receivedAt":"2020-01-21T21:58:18Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> Take advantage of helper function 'test_path_is_file()' to\n> replace 'test -f' since the function makes the code more\n> readable and gives better error messages.\n\nLooks good.  Thanks.\n"}]}