{"thread":{"id":"49402","subject":"[PATCH 0/3] bring some tests to newer style.","startedAt":"2018-09-21T23:58:46Z","lastAt":"2018-09-25T20:36:55Z","messageCount":8,"participants":["Stefan Beller","Derrick Stolee","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"358691","messageId":"20180921235833.99045-1-sbeller@google.com","threadId":"49402","inReplyTo":null,"subject":"[PATCH 0/3] bring some tests to newer style.","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-21T23:58:30Z","receivedAt":"2018-09-21T23:58:46Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The old formatting style is a real hindrance of getting people up to speed\ncontributing as they use existing code as an example and follow that style.\nSo let's get rid of the old style and reformat it in our current style.\n\nThis was reported off list by Derrick and Jeff as both of them followed\noutdated formatting style for their first patches only to have a long\ndiscussion on the mailing list on style.\n\nThe tests changed are not modified in origin/master..origin/pu,\nand they were changed using a hacky script:\n--8<--\n#!/usr/bin/python\nimport sys\ndef applyformat(fname):\n\twith open(fname, 'r') as f:\n\t\tlines = f.readlines()\n\t\tstate = \"lookingforstart\"\n\t\toutlines = []\n\t\tfor line in lines:\n\t\t\tif state == \"lookingforstart\":\n\t\t\t\tif line == \"test_expect_success \\\\\\n\":\n\t\t\t\t\tprint \"AHA!\"\n\t\t\t\t\tstate = \"firstlinefound\"\n\t\t\t\telse:\n\t\t\t\t\toutlines += [line]\n\t\t\telif state == \"firstlinefound\":\n\t\t\t\tl = line.strip()\n\t\t\t\tmust_strip = False\n\t\t\t\tif l.endswith(\"\\\\\"):\n\t\t\t\t\tl = l[:-1]\n\t\t\t\t\tmust_strip=True\n\t\t\t\tif l.endswith(\"'\"):\n\t\t\t\t\tl = l[:-1].strip()\n\t\t\t\tif l.startswith(\"'\"):\n\t\t\t\t\tline = \"test_expect_success \" + l + \" '\\n\"\n\t\t\t\t\toutlines += [line]\n\t\t\t\t\tstate = \"re-indent-until-done\"\n\t\t\t\telse:\n\t\t\t\t\tprint \"what?\"\n\t\t\t\t\texit(1)\n\t\t\telif state == \"re-indent-until-done\":\n\t\t\t\tl = line.strip()\n\t\t\t\tif must_strip:\n\t\t\t\t\tif l.startswith(\"'\"):\n\t\t\t\t\t\tl = l[1:]\n\t\t\t\t\t\tmust_strip = False\n\t\t\t\t\telse:\n\t\t\t\t\t\tprint \"what 1?\"\n\t\t\t\t\t\texit(1)\n\t\t\t\tif l.endswith(\"'\"):\n\t\t\t\t\tl = l[:-1]\n\t\t\t\t\tstate = \"lookingforstart\"\n\n\t\t\t\tif len(l):\n\t\t\t\t\tline = \"\t\" + l + \"\\n\"\n\t\t\t\t\toutlines += [line]\n\t\t\t\telif state == \"lookingforstart\":\n\t\t\t\t\t# skip an empty line before test is done\n\t\t\t\t\tpass\n\t\t\t\telse:\n\t\t\t\t\toutlines += [\"\\n\"]\n\n\t\t\t\tif state == \"lookingforstart\":\n\t\t\t\t\toutlines += [\"'\\n\"]\n\t\t\telse:\n\t\t\t\tprint \"what?\"\n\t\t\t\texit(1)\n\twith open(fname, 'w') as f:\n\t\tf.write(''.join(outlines))\n\nfor n in sys.argv[1:]:\n\tprint n\n\tapplyformat(n)\n--8<--\n\nThanks,\nStefan\n\nStefan Beller (3):\n  t7001: reformat to newer style\n  t7004: reformat style\n  t0030: reformat style\n\n t/t0030-stripspace.sh | 525 ++++++++++++++++++++----------------------\n t/t7001-mv.sh         | 268 ++++++++++-----------\n t/t7004-tag.sh        | 149 +++++-------\n 3 files changed, 444 insertions(+), 498 deletions(-)\n\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358692","messageId":"20180921235833.99045-2-sbeller@google.com","threadId":"49402","inReplyTo":"20180921235833.99045-1-sbeller@google.com","subject":"[PATCH 1/3] t7001: reformat to newer style","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-21T23:58:31Z","receivedAt":"2018-09-21T23:58:54Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"The old formatting style is a real hindrance of getting people up to speed\ncontributing as they use existing code as an example and follow that style.\nSo let's get rid of the old style and reformat it in our current style.\n\nReported-by: Derrick Stolee <stolee@gmail.com>\nReported-by: Jeff Hostetler <git@jeffhostetler.com>\nSigned-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t7001-mv.sh | 268 +++++++++++++++++++++++++-------------------------\n 1 file changed, 134 insertions(+), 134 deletions(-)\n\ndiff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\nindex 36b50d0b4c1..2251d24735c 100755\n--- a/t/t7001-mv.sh\n+++ b/t/t7001-mv.sh\n@@ -3,74 +3,74 @@\n test_description='git mv in subdirs'\n . ./test-lib.sh\n \n-test_expect_success \\\n-    'prepare reference tree' \\\n-    'mkdir path0 path1 &&\n-     cp \"$TEST_DIRECTORY\"/../COPYING path0/COPYING &&\n-     git add path0/COPYING &&\n-     git commit -m add -a'\n+test_expect_success 'prepare reference tree' '\n+\tmkdir path0 path1 &&\n+\tcp \"$TEST_DIRECTORY\"/../COPYING path0/COPYING &&\n+\tgit add path0/COPYING &&\n+\tgit commit -m add -a\n+'\n \n-test_expect_success \\\n-    'moving the file out of subdirectory' \\\n-    'cd path0 && git mv COPYING ../path1/COPYING'\n+test_expect_success 'moving the file out of subdirectory' '\n+\tcd path0 && git mv COPYING ../path1/COPYING\n+'\n \n # in path0 currently\n-test_expect_success \\\n-    'commiting the change' \\\n-    'cd .. && git commit -m move-out -a'\n+test_expect_success 'commiting the change' '\n+\tcd .. && git commit -m move-out -a\n+'\n \n-test_expect_success \\\n-    'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n-    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n+test_expect_success 'checking the commit' '\n+\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+\tgrep \"^R100..*path0/COPYING..*path1/COPYING\" actual\n+'\n \n-test_expect_success \\\n-    'moving the file back into subdirectory' \\\n-    'cd path0 && git mv ../path1/COPYING COPYING'\n+test_expect_success 'moving the file back into subdirectory' '\n+\tcd path0 && git mv ../path1/COPYING COPYING\n+'\n \n # in path0 currently\n-test_expect_success \\\n-    'commiting the change' \\\n-    'cd .. && git commit -m move-in -a'\n-\n-test_expect_success \\\n-    'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n-    grep \"^R100..*path1/COPYING..*path0/COPYING\" actual'\n-\n-test_expect_success \\\n-    'mv --dry-run does not move file' \\\n-    'git mv -n path0/COPYING MOVED &&\n-     test -f path0/COPYING &&\n-     test ! -f MOVED'\n-\n-test_expect_success \\\n-    'checking -k on non-existing file' \\\n-    'git mv -k idontexist path0'\n-\n-test_expect_success \\\n-    'checking -k on untracked file' \\\n-    'touch untracked1 &&\n-     git mv -k untracked1 path0 &&\n-     test -f untracked1 &&\n-     test ! -f path0/untracked1'\n-\n-test_expect_success \\\n-    'checking -k on multiple untracked files' \\\n-    'touch untracked2 &&\n-     git mv -k untracked1 untracked2 path0 &&\n-     test -f untracked1 &&\n-     test -f untracked2 &&\n-     test ! -f path0/untracked1 &&\n-     test ! -f path0/untracked2'\n-\n-test_expect_success \\\n-    'checking -f on untracked file with existing target' \\\n-    'touch path0/untracked1 &&\n-     test_must_fail git mv -f untracked1 path0 &&\n-     test ! -f .git/index.lock &&\n-     test -f untracked1 &&\n-     test -f path0/untracked1'\n+test_expect_success 'commiting the change' '\n+\tcd .. && git commit -m move-in -a\n+'\n+\n+test_expect_success 'checking the commit' '\n+\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+\tgrep \"^R100..*path1/COPYING..*path0/COPYING\" actual\n+'\n+\n+test_expect_success 'mv --dry-run does not move file' '\n+\tgit mv -n path0/COPYING MOVED &&\n+\ttest -f path0/COPYING &&\n+\ttest ! -f MOVED\n+'\n+\n+test_expect_success 'checking -k on non-existing file' '\n+\tgit mv -k idontexist path0\n+'\n+\n+test_expect_success 'checking -k on untracked file' '\n+\ttouch untracked1 &&\n+\tgit mv -k untracked1 path0 &&\n+\ttest -f untracked1 &&\n+\ttest ! -f path0/untracked1\n+'\n+\n+test_expect_success 'checking -k on multiple untracked files' '\n+\ttouch untracked2 &&\n+\tgit mv -k untracked1 untracked2 path0 &&\n+\ttest -f untracked1 &&\n+\ttest -f untracked2 &&\n+\ttest ! -f path0/untracked1 &&\n+\ttest ! -f path0/untracked2\n+'\n+\n+test_expect_success 'checking -f on untracked file with existing target' '\n+\ttouch path0/untracked1 &&\n+\ttest_must_fail git mv -f untracked1 path0 &&\n+\ttest ! -f .git/index.lock &&\n+\ttest -f untracked1 &&\n+\ttest -f path0/untracked1\n+'\n \n # clean up the mess in case bad things happen\n rm -f idontexist untracked1 untracked2 \\\n@@ -78,79 +78,79 @@ rm -f idontexist untracked1 untracked2 \\\n      .git/index.lock\n rmdir path1\n \n-test_expect_success \\\n-    'moving to absent target with trailing slash' \\\n-    'test_must_fail git mv path0/COPYING no-such-dir/ &&\n-     test_must_fail git mv path0/COPYING no-such-dir// &&\n-     git mv path0/ no-such-dir/ &&\n-     test_path_is_dir no-such-dir'\n-\n-test_expect_success \\\n-    'clean up' \\\n-    'git reset --hard'\n-\n-test_expect_success \\\n-    'moving to existing untracked target with trailing slash' \\\n-    'mkdir path1 &&\n-     git mv path0/ path1/ &&\n-     test_path_is_dir path1/path0/'\n-\n-test_expect_success \\\n-    'moving to existing tracked target with trailing slash' \\\n-    'mkdir path2 &&\n-     >path2/file && git add path2/file &&\n-     git mv path1/path0/ path2/ &&\n-     test_path_is_dir path2/path0/'\n-\n-test_expect_success \\\n-    'clean up' \\\n-    'git reset --hard'\n-\n-test_expect_success \\\n-    'adding another file' \\\n-    'cp \"$TEST_DIRECTORY\"/../README.md path0/README &&\n-     git add path0/README &&\n-     git commit -m add2 -a'\n-\n-test_expect_success \\\n-    'moving whole subdirectory' \\\n-    'git mv path0 path2'\n-\n-test_expect_success \\\n-    'commiting the change' \\\n-    'git commit -m dir-move -a'\n-\n-test_expect_success \\\n-    'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n-     grep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n-     grep \"^R100..*path0/README..*path2/README\" actual'\n-\n-test_expect_success \\\n-    'succeed when source is a prefix of destination' \\\n-    'git mv path2/COPYING path2/COPYING-renamed'\n-\n-test_expect_success \\\n-    'moving whole subdirectory into subdirectory' \\\n-    'git mv path2 path1'\n-\n-test_expect_success \\\n-    'commiting the change' \\\n-    'git commit -m dir-move -a'\n-\n-test_expect_success \\\n-    'checking the commit' \\\n-    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n-     grep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n-     grep \"^R100..*path2/README..*path1/path2/README\" actual'\n-\n-test_expect_success \\\n-    'do not move directory over existing directory' \\\n-    'mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0'\n-\n-test_expect_success \\\n-    'move into \".\"' \\\n-    'git mv path1/path2/ .'\n+test_expect_success 'moving to absent target with trailing slash' '\n+\ttest_must_fail git mv path0/COPYING no-such-dir/ &&\n+\ttest_must_fail git mv path0/COPYING no-such-dir// &&\n+\tgit mv path0/ no-such-dir/ &&\n+\ttest_path_is_dir no-such-dir\n+'\n+\n+test_expect_success 'clean up' '\n+\tgit reset --hard\n+'\n+\n+test_expect_success 'moving to existing untracked target with trailing slash' '\n+\tmkdir path1 &&\n+\tgit mv path0/ path1/ &&\n+\ttest_path_is_dir path1/path0/\n+'\n+\n+test_expect_success 'moving to existing tracked target with trailing slash' '\n+\tmkdir path2 &&\n+\t>path2/file && git add path2/file &&\n+\tgit mv path1/path0/ path2/ &&\n+\ttest_path_is_dir path2/path0/\n+'\n+\n+test_expect_success 'clean up' '\n+\tgit reset --hard\n+'\n+\n+test_expect_success 'adding another file' '\n+\tcp \"$TEST_DIRECTORY\"/../README.md path0/README &&\n+\tgit add path0/README &&\n+\tgit commit -m add2 -a\n+'\n+\n+test_expect_success 'moving whole subdirectory' '\n+\tgit mv path0 path2\n+'\n+\n+test_expect_success 'commiting the change' '\n+\tgit commit -m dir-move -a\n+'\n+\n+test_expect_success 'checking the commit' '\n+\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+\tgrep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n+\tgrep \"^R100..*path0/README..*path2/README\" actual\n+'\n+\n+test_expect_success 'succeed when source is a prefix of destination' '\n+\tgit mv path2/COPYING path2/COPYING-renamed\n+'\n+\n+test_expect_success 'moving whole subdirectory into subdirectory' '\n+\tgit mv path2 path1\n+'\n+\n+test_expect_success 'commiting the change' '\n+\tgit commit -m dir-move -a\n+'\n+\n+test_expect_success 'checking the commit' '\n+\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n+\tgrep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n+\tgrep \"^R100..*path2/README..*path1/path2/README\" actual\n+'\n+\n+test_expect_success 'do not move directory over existing directory' '\n+\tmkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0\n+'\n+\n+test_expect_success 'move into \".\"' '\n+\tgit mv path1/path2/ .\n+'\n \n test_expect_success \"Michael Cassar's test case\" '\n \trm -fr .git papers partA &&\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358693","messageId":"20180921235833.99045-3-sbeller@google.com","threadId":"49402","inReplyTo":"20180921235833.99045-1-sbeller@google.com","subject":"[PATCH 2/3] t7004: reformat style","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-21T23:58:32Z","receivedAt":"2018-09-21T23:59:03Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t7004-tag.sh | 149 +++++++++++++++++++------------------------------\n 1 file changed, 56 insertions(+), 93 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 0b01862c23a..03a96b7f79e 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -144,26 +144,25 @@ test_expect_success 'listing a tag using a matching pattern should succeed' \\\n test_expect_success 'listing a tag with --ignore-case' \\\n \t'test $(git tag -l --ignore-case MYTAG) = mytag'\n \n-test_expect_success \\\n-\t'listing a tag using a matching pattern should output that tag' \\\n-\t'test $(git tag -l mytag) = mytag'\n+test_expect_success 'listing a tag using a matching pattern should output that tag'  '\n+\ttest $(git tag -l mytag) = mytag\n+'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should succeed' \\\n-\t'git tag -l xxx'\n+test_expect_success 'listing tags using a non-matching pattern should succeed'  '\n+\tgit tag -l xxx\n+'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should output nothing' \\\n-\t'test $(git tag -l xxx | wc -l) -eq 0'\n+test_expect_success 'listing tags using a non-matching pattern should output nothing'  '\n+\ttest $(git tag -l xxx | wc -l) -eq 0\n+'\n \n # special cases for creating tags:\n \n-test_expect_success \\\n-\t'trying to create a tag with the name of one existing should fail' \\\n-\t'test_must_fail git tag mytag'\n+test_expect_success 'trying to create a tag with the name of one existing should fail'  '\n+\ttest_must_fail git tag mytag\n+'\n \n-test_expect_success \\\n-\t'trying to create a tag with a non-valid name should fail' '\n+test_expect_success 'trying to create a tag with a non-valid name should fail' '\n \ttest $(git tag -l | wc -l) -eq 1 &&\n \ttest_must_fail git tag \"\" &&\n \ttest_must_fail git tag .othertag &&\n@@ -201,15 +200,13 @@ cat >expect <<EOF\n myhead\n mytag\n EOF\n-test_expect_success \\\n-\t'trying to delete tags without params should succeed and do nothing' '\n+test_expect_success 'trying to delete tags without params should succeed and do nothing' '\n \tgit tag -l > actual && test_cmp expect actual &&\n \tgit tag -d &&\n \tgit tag -l > actual && test_cmp expect actual\n '\n \n-test_expect_success \\\n-\t'deleting two existing tags in one command should succeed' '\n+test_expect_success 'deleting two existing tags in one command should succeed' '\n \ttag_exists mytag &&\n \ttag_exists myhead &&\n \tgit tag -d mytag myhead &&\n@@ -217,15 +214,13 @@ test_expect_success \\\n \t! tag_exists myhead\n '\n \n-test_expect_success \\\n-\t'creating a tag with the name of another deleted one should succeed' '\n+test_expect_success 'creating a tag with the name of another deleted one should succeed' '\n \t! tag_exists mytag &&\n \tgit tag mytag &&\n \ttag_exists mytag\n '\n \n-test_expect_success \\\n-\t'trying to delete two tags, existing and not, should fail in the 2nd' '\n+test_expect_success 'trying to delete two tags, existing and not, should fail in the 2nd' '\n \ttag_exists mytag &&\n \t! tag_exists myhead &&\n \ttest_must_fail git tag -d mytag anothertag &&\n@@ -270,8 +265,7 @@ a1\n aa1\n cba\n EOF\n-test_expect_success \\\n-\t'listing tags with substring as pattern must print those matching' '\n+test_expect_success 'listing tags with substring as pattern must print those matching' '\n \trm *a* &&\n \tgit tag -l \"*a*\" > current &&\n \ttest_cmp expect current\n@@ -281,8 +275,7 @@ cat >expect <<EOF\n v0.2.1\n v1.0.1\n EOF\n-test_expect_success \\\n-\t'listing tags with a suffix as pattern must print those matching' '\n+test_expect_success 'listing tags with a suffix as pattern must print those matching' '\n \tgit tag -l \"*.1\" > actual &&\n \ttest_cmp expect actual\n '\n@@ -291,8 +284,7 @@ cat >expect <<EOF\n t210\n t211\n EOF\n-test_expect_success \\\n-\t'listing tags with a prefix as pattern must print those matching' '\n+test_expect_success 'listing tags with a prefix as pattern must print those matching' '\n \tgit tag -l \"t21*\" > actual &&\n \ttest_cmp expect actual\n '\n@@ -300,8 +292,7 @@ test_expect_success \\\n cat >expect <<EOF\n a1\n EOF\n-test_expect_success \\\n-\t'listing tags using a name as pattern must print that one matching' '\n+test_expect_success 'listing tags using a name as pattern must print that one matching' '\n \tgit tag -l a1 > actual &&\n \ttest_cmp expect actual\n '\n@@ -309,8 +300,7 @@ test_expect_success \\\n cat >expect <<EOF\n v1.0\n EOF\n-test_expect_success \\\n-\t'listing tags using a name as pattern must print that one matching' '\n+test_expect_success 'listing tags using a name as pattern must print that one matching' '\n \tgit tag -l v1.0 > actual &&\n \ttest_cmp expect actual\n '\n@@ -319,14 +309,12 @@ cat >expect <<EOF\n v1.0.1\n v1.1.3\n EOF\n-test_expect_success \\\n-\t'listing tags with ? in the pattern should print those matching' '\n+test_expect_success 'listing tags with ? in the pattern should print those matching' '\n \tgit tag -l \"v1.?.?\" > actual &&\n \ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-\t'listing tags using v.* should print nothing because none have v.' '\n+test_expect_success 'listing tags using v.* should print nothing because none have v.' '\n \tgit tag -l \"v.*\" > actual &&\n \ttest_must_be_empty actual\n '\n@@ -337,8 +325,7 @@ v1.0\n v1.0.1\n v1.1.3\n EOF\n-test_expect_success \\\n-\t'listing tags using v* should print only those having v' '\n+test_expect_success 'listing tags using v* should print only those having v' '\n \tgit tag -l \"v*\" > actual &&\n \ttest_cmp expect actual\n '\n@@ -404,8 +391,7 @@ EOF\n \n # creating and verifying lightweight tags:\n \n-test_expect_success \\\n-\t'a non-annotated tag created without parameters should point to HEAD' '\n+test_expect_success 'a non-annotated tag created without parameters should point to HEAD' '\n \tgit tag non-annotated-tag &&\n \ttest $(git cat-file -t non-annotated-tag) = commit &&\n \ttest $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)\n@@ -414,13 +400,13 @@ test_expect_success \\\n test_expect_success 'trying to verify an unknown tag should fail' \\\n \t'test_must_fail git tag -v unknown-tag'\n \n-test_expect_success \\\n-\t'trying to verify a non-annotated and non-signed tag should fail' \\\n-\t'test_must_fail git tag -v non-annotated-tag'\n+test_expect_success 'trying to verify a non-annotated and non-signed tag should fail'  '\n+\ttest_must_fail git tag -v non-annotated-tag\n+'\n \n-test_expect_success \\\n-\t'trying to verify many non-annotated or unknown tags, should fail' \\\n-\t'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2'\n+test_expect_success 'trying to verify many non-annotated or unknown tags, should fail'  '\n+\ttest_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2\n+'\n \n # creating annotated tags:\n \n@@ -444,8 +430,7 @@ time=$test_tick\n \n get_tag_header annotated-tag $commit commit $time >expect\n echo \"A message\" >>expect\n-test_expect_success \\\n-\t'creating an annotated tag with -m message should succeed' '\n+test_expect_success 'creating an annotated tag with -m message should succeed' '\n \tgit tag -m \"A message\" annotated-tag &&\n \tget_tag_msg annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -459,8 +444,7 @@ test_expect_success 'set up editor' '\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n-test_expect_success \\\n-\t'creating an annotated tag with -m message --edit should succeed' '\n+test_expect_success 'creating an annotated tag with -m message --edit should succeed' '\n \tGIT_EDITOR=./fakeeditor git tag -m \"A message\" --edit annotated-tag-edit &&\n \tget_tag_msg annotated-tag-edit >actual &&\n \ttest_cmp expect actual\n@@ -472,8 +456,7 @@ in a file.\n EOF\n get_tag_header file-annotated-tag $commit commit $time >expect\n cat msgfile >>expect\n-test_expect_success \\\n-\t'creating an annotated tag with -F messagefile should succeed' '\n+test_expect_success 'creating an annotated tag with -F messagefile should succeed' '\n \tgit tag -F msgfile file-annotated-tag &&\n \tget_tag_msg file-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -487,8 +470,7 @@ test_expect_success 'set up editor' '\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n-test_expect_success \\\n-\t'creating an annotated tag with -F messagefile --edit should succeed' '\n+test_expect_success 'creating an annotated tag with -F messagefile --edit should succeed' '\n \tGIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit &&\n \tget_tag_msg file-annotated-tag-edit >actual &&\n \ttest_cmp expect actual\n@@ -506,16 +488,14 @@ test_expect_success 'creating an annotated tag with -F - should succeed' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-\t'trying to create a tag with a non-existing -F file should fail' '\n+test_expect_success 'trying to create a tag with a non-existing -F file should fail' '\n \t! test -f nonexistingfile &&\n \t! tag_exists notag &&\n \ttest_must_fail git tag -F nonexistingfile notag &&\n \t! tag_exists notag\n '\n \n-test_expect_success \\\n-\t'trying to create tags giving both -m or -F options should fail' '\n+test_expect_success 'trying to create tags giving both -m or -F options should fail' '\n \techo \"message file 1\" >msgfile1 &&\n \techo \"message file 2\" >msgfile2 &&\n \t! tag_exists msgtag &&\n@@ -524,15 +504,14 @@ test_expect_success \\\n \ttest_must_fail git tag -F msgfile1 -m \"message 1\" msgtag &&\n \t! tag_exists msgtag &&\n \ttest_must_fail git tag -m \"message 1\" -F msgfile1 \\\n-\t\t-m \"message 2\" msgtag &&\n+\t-m \"message 2\" msgtag &&\n \t! tag_exists msgtag\n '\n \n # blank and empty messages:\n \n get_tag_header empty-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with an empty -m message should succeed' '\n+test_expect_success 'creating a tag with an empty -m message should succeed' '\n \tgit tag -m \"\" empty-annotated-tag &&\n \tget_tag_msg empty-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -540,8 +519,7 @@ test_expect_success \\\n \n >emptyfile\n get_tag_header emptyfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with an empty -F messagefile should succeed' '\n+test_expect_success 'creating a tag with an empty -F messagefile should succeed' '\n \tgit tag -F emptyfile emptyfile-annotated-tag &&\n \tget_tag_msg emptyfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -561,16 +539,14 @@ Trailing spaces\n \n Trailing blank lines\n EOF\n-test_expect_success \\\n-\t'extra blanks in the message for an annotated tag should be removed' '\n+test_expect_success 'extra blanks in the message for an annotated tag should be removed' '\n \tgit tag -F blanksfile blanks-annotated-tag &&\n \tget_tag_msg blanks-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n get_tag_header blank-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with blank -m message with spaces should succeed' '\n+test_expect_success 'creating a tag with blank -m message with spaces should succeed' '\n \tgit tag -m \"     \" blank-annotated-tag &&\n \tget_tag_msg blank-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -580,8 +556,7 @@ echo '     ' >blankfile\n echo ''      >>blankfile\n echo '  '    >>blankfile\n get_tag_header blankfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with blank -F messagefile with spaces should succeed' '\n+test_expect_success 'creating a tag with blank -F messagefile with spaces should succeed' '\n \tgit tag -F blankfile blankfile-annotated-tag &&\n \tget_tag_msg blankfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -589,8 +564,7 @@ test_expect_success \\\n \n printf '      ' >blanknonlfile\n get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with -F file of spaces and no newline should succeed' '\n+test_expect_success 'creating a tag with -F file of spaces and no newline should succeed' '\n \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n \tget_tag_msg blanknonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -624,16 +598,14 @@ Another line.\n \n Last line.\n EOF\n-test_expect_success \\\n-\t'creating a tag using a -F messagefile with #comments should succeed' '\n+test_expect_success 'creating a tag using a -F messagefile with #comments should succeed' '\n \tgit tag -F commentsfile comments-annotated-tag &&\n \tget_tag_msg comments-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n get_tag_header comment-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with a #comment in the -m message should succeed' '\n+test_expect_success 'creating a tag with a #comment in the -m message should succeed' '\n \tgit tag -m \"#comment\" comment-annotated-tag &&\n \tget_tag_msg comment-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -643,8 +615,7 @@ echo '#comment' >commentfile\n echo ''         >>commentfile\n echo '####'     >>commentfile\n get_tag_header commentfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with #comments in the -F messagefile should succeed' '\n+test_expect_success 'creating a tag with #comments in the -F messagefile should succeed' '\n \tgit tag -F commentfile commentfile-annotated-tag &&\n \tget_tag_msg commentfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -652,8 +623,7 @@ test_expect_success \\\n \n printf '#comment' >commentnonlfile\n get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with a file of #comment and no newline should succeed' '\n+test_expect_success 'creating a tag with a file of #comment and no newline should succeed' '\n \tgit tag -F commentnonlfile commentnonlfile-annotated-tag &&\n \tget_tag_msg commentnonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -661,8 +631,7 @@ test_expect_success \\\n \n # listing messages for annotated non-signed tags:\n \n-test_expect_success \\\n-\t'listing the one-line message of a non-signed tag should succeed' '\n+test_expect_success 'listing the one-line message of a non-signed tag should succeed' '\n \tgit tag -m \"A msg\" tag-one-line &&\n \n \techo \"tag-one-line\" >expect &&\n@@ -701,8 +670,7 @@ test_expect_success 'The -n 100 invocation means -n --list 100, not -n100' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-\t'listing the zero-lines message of a non-signed tag should succeed' '\n+test_expect_success 'listing the zero-lines message of a non-signed tag should succeed' '\n \tgit tag -m \"\" tag-zero-lines &&\n \n \techo \"tag-zero-lines\" >expect &&\n@@ -729,8 +697,7 @@ test_expect_success \\\n echo 'tag line one' >annotagmsg\n echo 'tag line two' >>annotagmsg\n echo 'tag line three' >>annotagmsg\n-test_expect_success \\\n-\t'listing many message lines of a non-signed tag should succeed' '\n+test_expect_success 'listing many message lines of a non-signed tag should succeed' '\n \tgit tag -F annotagmsg tag-lines &&\n \n \techo \"tag-lines\" >expect &&\n@@ -1372,13 +1339,11 @@ test_expect_success GPG \\\n \t'verify signed tag fails when public key is not present' \\\n \t'test_must_fail git tag -v signed-tag'\n \n-test_expect_success \\\n-\t'git tag -a fails if tag annotation is empty' '\n+test_expect_success 'git tag -a fails if tag annotation is empty' '\n \t! (GIT_EDITOR=cat git tag -a initial-comment)\n '\n \n-test_expect_success \\\n-\t'message in editor has initial comment' '\n+test_expect_success 'message in editor has initial comment' '\n \t! (GIT_EDITOR=cat git tag -a initial-comment > actual)\n '\n \n@@ -1389,8 +1354,7 @@ test_expect_success 'message in editor has initial comment: first line' '\n \ttest_i18ncmp first.expect first.actual\n '\n \n-test_expect_success \\\n-\t'message in editor has initial comment: remainder' '\n+test_expect_success 'message in editor has initial comment: remainder' '\n \t# remove commented lines from the remainder -- should be empty\n \tsed -e 1d -e \"/^#/d\" <actual >rest.actual &&\n \ttest_must_be_empty rest.actual\n@@ -1398,8 +1362,7 @@ test_expect_success \\\n \n get_tag_header reuse $commit commit $time >expect\n echo \"An annotation to be reused\" >> expect\n-test_expect_success \\\n-\t'overwriting an annoted tag should use its previous body' '\n+test_expect_success 'overwriting an annoted tag should use its previous body' '\n \tgit tag -a -m \"An annotation to be reused\" reuse &&\n \tGIT_EDITOR=true git tag -f -a reuse &&\n \tget_tag_msg reuse >actual &&\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358694","messageId":"20180921235833.99045-4-sbeller@google.com","threadId":"49402","inReplyTo":"20180921235833.99045-1-sbeller@google.com","subject":"[PATCH 3/3] t0030: reformat style","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-21T23:58:33Z","receivedAt":"2018-09-21T23:59:13Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"Signed-off-by: Stefan Beller <sbeller@google.com>\n---\n t/t0030-stripspace.sh | 525 ++++++++++++++++++++----------------------\n 1 file changed, 254 insertions(+), 271 deletions(-)\n\ndiff --git a/t/t0030-stripspace.sh b/t/t0030-stripspace.sh\nindex 5ce47e8af51..c2281a39b58 100755\n--- a/t/t0030-stripspace.sh\n+++ b/t/t0030-stripspace.sh\n@@ -12,379 +12,362 @@ s40='                                        '\n sss=\"$s40$s40$s40$s40$s40$s40$s40$s40$s40$s40\" # 400\n ttt=\"$t40$t40$t40$t40$t40$t40$t40$t40$t40$t40\" # 400\n \n-test_expect_success \\\n-    'long lines without spaces should be unchanged' '\n-    echo \"$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n-\n-    echo \"$ttt$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n-\n-    echo \"$ttt$ttt$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n-\n-    echo \"$ttt$ttt$ttt$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual\n+test_expect_success 'long lines without spaces should be unchanged' '\n+\techo \"$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n+\n+\techo \"$ttt$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n+\n+\techo \"$ttt$ttt$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n+\n+\techo \"$ttt$ttt$ttt$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'lines with spaces at the beginning should be unchanged' '\n-    echo \"$sss$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'lines with spaces at the beginning should be unchanged' '\n+\techo \"$sss$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$sss$sss$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n+\techo \"$sss$sss$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$sss$sss$sss$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual\n+\techo \"$sss$sss$sss$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'lines with intermediate spaces should be unchanged' '\n-    echo \"$ttt$sss$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'lines with intermediate spaces should be unchanged' '\n+\techo \"$ttt$sss$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt$sss$sss$ttt\" >expect &&\n-    git stripspace <expect >actual &&\n-    test_cmp expect actual\n+\techo \"$ttt$sss$sss$ttt\" >expect &&\n+\tgit stripspace <expect >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'consecutive blank lines should be unified' '\n-    printf \"$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'consecutive blank lines should be unified' '\n+\tprintf \"$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\\n\\n\\n$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\\n\\n\\n$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\\n\\n\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\\n\\n\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\tprintf \"$ttt\\n\\n$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\t\\n \\n\\n  \\t\\t\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'only consecutive blank lines should be completely removed' '\n+test_expect_success 'only consecutive blank lines should be completely removed' '\n \n-    printf \"\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"\\n\\n\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss\\n$sss\\n$sss\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"$sss\\n$sss\\n$sss\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss$sss\\n$sss\\n\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"$sss$sss\\n$sss\\n\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"\\n$sss\\n$sss$sss\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"\\n$sss\\n$sss$sss\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss$sss$sss$sss\\n\\n\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"$sss$sss$sss$sss\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"\\n$sss$sss$sss$sss\\n\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"\\n$sss$sss$sss$sss\\n\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"\\n\\n$sss$sss$sss$sss\\n\" | git stripspace >actual &&\n-    test_must_be_empty actual\n+\tprintf \"\\n\\n$sss$sss$sss$sss\\n\" | git stripspace >actual &&\n+\ttest_must_be_empty actual\n '\n \n-test_expect_success \\\n-    'consecutive blank lines at the beginning should be removed' '\n-    printf \"$ttt\\n\" > expect &&\n-    printf \"\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'consecutive blank lines at the beginning should be removed' '\n+\tprintf \"$ttt\\n\" > expect &&\n+\tprintf \"\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" > expect &&\n-    printf \"\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\" > expect &&\n+\tprintf \"\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\" > expect &&\n-    printf \"\\n\\n\\n$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\" > expect &&\n+\tprintf \"\\n\\n\\n$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"\\n\\n\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"\\n\\n\\n$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"\\n\\n\\n$ttt$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"\\n\\n\\n$ttt$ttt$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\" > expect &&\n \n-    printf \"$sss\\n$sss\\n$sss\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$sss\\n$sss\\n$sss\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"\\n$sss\\n$sss$sss\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"\\n$sss\\n$sss$sss\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$sss$sss\\n$sss\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$sss$sss\\n$sss\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$sss$sss$sss\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$sss$sss$sss\\n\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"\\n$sss$sss$sss\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"\\n$sss$sss$sss\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"\\n\\n$sss$sss$sss\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\tprintf \"\\n\\n$sss$sss$sss\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'consecutive blank lines at the end should be removed' '\n-    printf \"$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'consecutive blank lines at the end should be removed' '\n+\tprintf \"$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" > expect &&\n-    printf \"$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt$ttt\\n\" > expect &&\n-    printf \"$ttt$ttt$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt$ttt$ttt\\n\" > expect &&\n+\tprintf \"$ttt$ttt$ttt$ttt\\n\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" > expect &&\n+\tprintf \"$ttt\\n\" > expect &&\n \n-    printf \"$ttt\\n$sss\\n$sss\\n$sss\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$sss\\n$sss\\n$sss\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$sss\\n$sss$sss\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$sss\\n$sss$sss\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$sss$sss\\n$sss\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$sss$sss\\n$sss\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$sss$sss$sss\\n\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$sss$sss$sss\\n\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n$sss$sss$sss\\n\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\\n$sss$sss$sss\\n\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\\n\\n$sss$sss$sss\\n\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\tprintf \"$ttt\\n\\n\\n$sss$sss$sss\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'text without newline at end should end with newline' '\n-    test $(printf \"$ttt\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt$ttt\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt$ttt$ttt\" | git stripspace | wc -l) -gt 0\n+test_expect_success 'text without newline at end should end with newline' '\n+\ttest $(printf \"$ttt\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt$ttt\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt$ttt$ttt\" | git stripspace | wc -l) -gt 0\n '\n \n # text plus spaces at the end:\n \n-test_expect_success \\\n-    'text plus spaces without newline at end should end with newline' '\n-    test $(printf \"$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$sss$sss\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$ttt$sss$sss\" | git stripspace | wc -l) -gt 0 &&\n-    test $(printf \"$ttt$sss$sss$sss\" | git stripspace | wc -l) -gt 0\n+test_expect_success 'text plus spaces without newline at end should end with newline' '\n+\ttest $(printf \"$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt$ttt$sss\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$sss$sss\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$ttt$sss$sss\" | git stripspace | wc -l) -gt 0 &&\n+\ttest $(printf \"$ttt$sss$sss$sss\" | git stripspace | wc -l) -gt 0\n '\n \n-test_expect_success \\\n-    'text plus spaces without newline at end should not show spaces' '\n-    ! (printf \"$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (printf \"$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (printf \"$ttt$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (printf \"$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (printf \"$ttt$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (printf \"$ttt$sss$sss$sss\" | git stripspace | grep \"  \" >/dev/null)\n+test_expect_success 'text plus spaces without newline at end should not show spaces' '\n+\t! (printf \"$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (printf \"$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (printf \"$ttt$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (printf \"$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (printf \"$ttt$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (printf \"$ttt$sss$sss$sss\" | git stripspace | grep \"  \" >/dev/null)\n '\n \n-test_expect_success \\\n-    'text plus spaces without newline should show the correct lines' '\n-    printf \"$ttt\\n\" >expect &&\n-    printf \"$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'text plus spaces without newline should show the correct lines' '\n+\tprintf \"$ttt\\n\" >expect &&\n+\tprintf \"$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" >expect &&\n-    printf \"$ttt$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\" >expect &&\n+\tprintf \"$ttt$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n\" >expect &&\n-    printf \"$ttt$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n\" >expect &&\n+\tprintf \"$ttt$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\" >expect &&\n-    printf \"$ttt$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\" >expect &&\n+\tprintf \"$ttt$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\" >expect &&\n-    printf \"$ttt$ttt$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\" >expect &&\n+\tprintf \"$ttt$ttt$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt$ttt\\n\" >expect &&\n-    printf \"$ttt$ttt$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\tprintf \"$ttt$ttt$ttt\\n\" >expect &&\n+\tprintf \"$ttt$ttt$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n-test_expect_success \\\n-    'text plus spaces at end should not show spaces' '\n-    ! (echo \"$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (echo \"$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (echo \"$ttt$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (echo \"$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (echo \"$ttt$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n-    ! (echo \"$ttt$sss$sss$sss\" | git stripspace | grep \"  \" >/dev/null)\n+test_expect_success 'text plus spaces at end should not show spaces' '\n+\t! (echo \"$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (echo \"$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (echo \"$ttt$ttt$ttt$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (echo \"$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (echo \"$ttt$ttt$sss$sss\" | git stripspace | grep \"  \" >/dev/null) &&\n+\t! (echo \"$ttt$sss$sss$sss\" | git stripspace | grep \"  \" >/dev/null)\n '\n \n-test_expect_success \\\n-    'text plus spaces at end should be cleaned and newline must remain' '\n-    echo \"$ttt\" >expect &&\n-    echo \"$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'text plus spaces at end should be cleaned and newline must remain' '\n+\techo \"$ttt\" >expect &&\n+\techo \"$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt\" >expect &&\n-    echo \"$ttt$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\techo \"$ttt\" >expect &&\n+\techo \"$ttt$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt\" >expect &&\n-    echo \"$ttt$sss$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\techo \"$ttt\" >expect &&\n+\techo \"$ttt$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt$ttt\" >expect &&\n-    echo \"$ttt$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\techo \"$ttt$ttt\" >expect &&\n+\techo \"$ttt$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt$ttt\" >expect &&\n-    echo \"$ttt$ttt$sss$sss\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\techo \"$ttt$ttt\" >expect &&\n+\techo \"$ttt$ttt$sss$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    echo \"$ttt$ttt$ttt\" >expect &&\n-    echo \"$ttt$ttt$ttt$sss\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\techo \"$ttt$ttt$ttt\" >expect &&\n+\techo \"$ttt$ttt$ttt$sss\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n # spaces only:\n \n-test_expect_success \\\n-    'spaces with newline at end should be replaced with empty string' '\n-    echo | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+test_expect_success 'spaces with newline at end should be replaced with empty string' '\n+\techo | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    echo \"$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\techo \"$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    echo \"$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\techo \"$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    echo \"$sss$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\techo \"$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    echo \"$sss$sss$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual\n+\techo \"$sss$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual\n '\n \n-test_expect_success \\\n-    'spaces without newline at end should not show spaces' '\n-    ! (printf \"\" | git stripspace | grep \" \" >/dev/null) &&\n-    ! (printf \"$sss\" | git stripspace | grep \" \" >/dev/null) &&\n-    ! (printf \"$sss$sss\" | git stripspace | grep \" \" >/dev/null) &&\n-    ! (printf \"$sss$sss$sss\" | git stripspace | grep \" \" >/dev/null) &&\n-    ! (printf \"$sss$sss$sss$sss\" | git stripspace | grep \" \" >/dev/null)\n+test_expect_success 'spaces without newline at end should not show spaces' '\n+\t! (printf \"\" | git stripspace | grep \" \" >/dev/null) &&\n+\t! (printf \"$sss\" | git stripspace | grep \" \" >/dev/null) &&\n+\t! (printf \"$sss$sss\" | git stripspace | grep \" \" >/dev/null) &&\n+\t! (printf \"$sss$sss$sss\" | git stripspace | grep \" \" >/dev/null) &&\n+\t! (printf \"$sss$sss$sss$sss\" | git stripspace | grep \" \" >/dev/null)\n '\n \n-test_expect_success \\\n-    'spaces without newline at end should be replaced with empty string' '\n-    printf \"\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+test_expect_success 'spaces without newline at end should be replaced with empty string' '\n+\tprintf \"\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual &&\n+\tprintf \"$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual &&\n \n-    printf \"$sss$sss$sss$sss\" | git stripspace >actual &&\n-    test_must_be_empty actual\n+\tprintf \"$sss$sss$sss$sss\" | git stripspace >actual &&\n+\ttest_must_be_empty actual\n '\n \n-test_expect_success \\\n-    'consecutive text lines should be unchanged' '\n-    printf \"$ttt$ttt\\n$ttt\\n\" >expect &&\n-    printf \"$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+test_expect_success 'consecutive text lines should be unchanged' '\n+\tprintf \"$ttt$ttt\\n$ttt\\n\" >expect &&\n+\tprintf \"$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$ttt$ttt\\n$ttt\\n\" >expect &&\n-    printf \"$ttt\\n$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$ttt$ttt\\n$ttt\\n\" >expect &&\n+\tprintf \"$ttt\\n$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$ttt\\n$ttt\\n$ttt$ttt\\n\" >expect &&\n-    printf \"$ttt\\n$ttt\\n$ttt\\n$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$ttt\\n$ttt\\n$ttt$ttt\\n\" >expect &&\n+\tprintf \"$ttt\\n$ttt\\n$ttt\\n$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$ttt\\n\\n$ttt$ttt\\n$ttt\\n\" >expect &&\n-    printf \"$ttt\\n$ttt\\n\\n$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt\\n$ttt\\n\\n$ttt$ttt\\n$ttt\\n\" >expect &&\n+\tprintf \"$ttt\\n$ttt\\n\\n$ttt$ttt\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt$ttt\\n\\n$ttt\\n$ttt$ttt\\n\" >expect &&\n-    printf \"$ttt$ttt\\n\\n$ttt\\n$ttt$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual &&\n+\tprintf \"$ttt$ttt\\n\\n$ttt\\n$ttt$ttt\\n\" >expect &&\n+\tprintf \"$ttt$ttt\\n\\n$ttt\\n$ttt$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual &&\n \n-    printf \"$ttt\\n$ttt$ttt\\n\\n$ttt\\n\" >expect &&\n-    printf \"$ttt\\n$ttt$ttt\\n\\n$ttt\\n\" | git stripspace >actual &&\n-    test_cmp expect actual\n+\tprintf \"$ttt\\n$ttt$ttt\\n\\n$ttt\\n\" >expect &&\n+\tprintf \"$ttt\\n$ttt$ttt\\n\\n$ttt\\n\" | git stripspace >actual &&\n+\ttest_cmp expect actual\n '\n \n test_expect_success 'strip comments, too' '\n-- \n2.19.0.444.g18242da7ef-goog\n\n"},{"id":"358753","messageId":"7f77be2b-a084-5b8d-df65-1bb4b9c5da82@gmail.com","threadId":"49402","inReplyTo":"20180921235833.99045-2-sbeller@google.com","subject":"Re: [PATCH 1/3] t7001: reformat to newer style","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2018-09-24T13:31:16Z","receivedAt":"2018-09-24T13:31:20Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 9/21/2018 7:58 PM, Stefan Beller wrote:\n> The old formatting style is a real hindrance of getting people up to speed\n> contributing as they use existing code as an example and follow that style.\n> So let's get rid of the old style and reformat it in our current style.\nI was suspicious of your automated approach catching everything, so I \nlooked carefully at this patch. There are still a lot of things \nhappening that we would not recommend doing in new tests.\n>\n> Reported-by: Derrick Stolee <stolee@gmail.com>\n> Reported-by: Jeff Hostetler <git@jeffhostetler.com>\n> Signed-off-by: Stefan Beller <sbeller@google.com>\n> ---\n>   t/t7001-mv.sh | 268 +++++++++++++++++++++++++-------------------------\n>   1 file changed, 134 insertions(+), 134 deletions(-)\n>\n> diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh\n> index 36b50d0b4c1..2251d24735c 100755\n> --- a/t/t7001-mv.sh\n> +++ b/t/t7001-mv.sh\n> @@ -3,74 +3,74 @@\n>   test_description='git mv in subdirs'\n>   . ./test-lib.sh\n>   \n> -test_expect_success \\\n> -    'prepare reference tree' \\\n> -    'mkdir path0 path1 &&\n> -     cp \"$TEST_DIRECTORY\"/../COPYING path0/COPYING &&\n> -     git add path0/COPYING &&\n> -     git commit -m add -a'\n> +test_expect_success 'prepare reference tree' '\n> +\tmkdir path0 path1 &&\n> +\tcp \"$TEST_DIRECTORY\"/../COPYING path0/COPYING &&\n> +\tgit add path0/COPYING &&\n> +\tgit commit -m add -a\n> +'\n>   \n> -test_expect_success \\\n> -    'moving the file out of subdirectory' \\\n> -    'cd path0 && git mv COPYING ../path1/COPYING'\n> +test_expect_success 'moving the file out of subdirectory' '\n> +\tcd path0 && git mv COPYING ../path1/COPYING\n> +'\nPerhaps split this line on the &&?\n>   \n>   # in path0 currently\n> -test_expect_success \\\n> -    'commiting the change' \\\n> -    'cd .. && git commit -m move-out -a'\n> +test_expect_success 'commiting the change' '\n> +\tcd .. && git commit -m move-out -a\n> +'\n\nThis \"cd ..\" should probably be removed and use a subshell in the test \nabove where we \"cd path0\".\n\n>   \n> -test_expect_success \\\n> -    'checking the commit' \\\n> -    'git diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> -    grep \"^R100..*path0/COPYING..*path1/COPYING\" actual'\n> +test_expect_success 'checking the commit' '\n> +\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> +\tgrep \"^R100..*path0/COPYING..*path1/COPYING\" actual\n> +'\n>   \n> -test_expect_success \\\n> -    'moving the file back into subdirectory' \\\n> -    'cd path0 && git mv ../path1/COPYING COPYING'\n> +test_expect_success 'moving the file back into subdirectory' '\n> +\tcd path0 && git mv ../path1/COPYING COPYING\n> +'\n\nSplit at &&, use subshell?\n\n\n> +test_expect_success 'commiting the change' '\n> +\tcd .. && git commit -m move-in -a\n> +'\n\nDrop \"cd ..\" (and the comments about being in path0)\n\n[big snip]\n\n> +test_expect_success 'moving to existing tracked target with trailing slash' '\n> +\tmkdir path2 &&\n> +\t>path2/file && git add path2/file &&\nThis line in particular looks a bit strange. What is this doing? At \nleast we should split the &&.\n> +\tgit mv path1/path0/ path2/ &&\n> +\ttest_path_is_dir path2/path0/\n> +'\n> +\n> +test_expect_success 'clean up' '\n> +\tgit reset --hard\n> +'\n> +\n> +test_expect_success 'adding another file' '\n> +\tcp \"$TEST_DIRECTORY\"/../README.md path0/README &&\n> +\tgit add path0/README &&\n> +\tgit commit -m add2 -a\n> +'\n> +\n> +test_expect_success 'moving whole subdirectory' '\n> +\tgit mv path0 path2\n> +'\n> +\n> +test_expect_success 'commiting the change' '\n> +\tgit commit -m dir-move -a\n> +'\n> +\n> +test_expect_success 'checking the commit' '\n> +\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> +\tgrep \"^R100..*path0/COPYING..*path2/COPYING\" actual &&\n> +\tgrep \"^R100..*path0/README..*path2/README\" actual\n> +'\n> +\n> +test_expect_success 'succeed when source is a prefix of destination' '\n> +\tgit mv path2/COPYING path2/COPYING-renamed\n> +'\n> +\n> +test_expect_success 'moving whole subdirectory into subdirectory' '\n> +\tgit mv path2 path1\n> +'\n> +\n> +test_expect_success 'commiting the change' '\n> +\tgit commit -m dir-move -a\n> +'\n> +\n> +test_expect_success 'checking the commit' '\n> +\tgit diff-tree -r -M --name-status  HEAD^ HEAD >actual &&\n> +\tgrep \"^R100..*path2/COPYING..*path1/path2/COPYING\" actual &&\n> +\tgrep \"^R100..*path2/README..*path1/path2/README\" actual\n> +'\n> +\n> +test_expect_success 'do not move directory over existing directory' '\n> +\tmkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0\n> +'\n\nSplit this line.\n\nThanks,\n\n-Stolee\n\n"},{"id":"358762","messageId":"xmqq4leeubah.fsf@gitster-ct.c.googlers.com","threadId":"49402","inReplyTo":"7f77be2b-a084-5b8d-df65-1bb4b9c5da82@gmail.com","subject":"Re: [PATCH 1/3] t7001: reformat to newer style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-24T16:09:58Z","receivedAt":"2018-09-24T16:10:03Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Derrick Stolee <stolee@gmail.com> writes:\n\n>> +test_expect_success 'moving the file back into subdirectory' '\n>> +\tcd path0 && git mv ../path1/COPYING COPYING\n>> +'\n>\n> Split at &&, use subshell?\n\nYes, I was almost going to point out the same, saying \"'reformat to\nnewer style' is much larger than only changing how the test body is\nformatted\", but was debating myself, as a good \"modernization patch\"\nneeds both mechanical changes and manual/semantic clean-ups, and it\nis very clear that these three patches deliberately limit themselves\nto the former for easier verification.\n\nIt is relatively rare that files are not touched by any in-flight\ntopic in the codebase, which is a good opportunity to apply this\nkind of wholesale clean-up, so I tend to agree that it is a shame\nnot to do the non-mechanical clean up in the same series.  Perhaps\nthe best way would be to keep these three mechanical steps as they\nare, and then follow-up with non-mechanical clean-up like you\nsuggested.\n\n>> +test_expect_success 'commiting the change' '\n>> +\tcd .. && git commit -m move-in -a\n>> +'\n>\n> Drop \"cd ..\" (and the comments about being in path0)\n\n... when the previous step moves to \"git -C path0 mv ...\" or\npreferrably \"(cd path0 && git mv ...)\".\n\n\n> [big snip]\n>\n>> +test_expect_success 'moving to existing tracked target with trailing slash' '\n>> +\tmkdir path2 &&\n>> +\t>path2/file && git add path2/file &&\n> This line in particular looks a bit strange. What is this doing? At\n> least we should split the &&.\n\nCreate an empty file by redirecting the output from a no-op into it,\nand then adding the result.  I agree with you that this would be\neasier to read on two lines.\n\n>> +\tgit mv path1/path0/ path2/ &&\n>> +\ttest_path_is_dir path2/path0/\n>> +'\n"},{"id":"358772","messageId":"CAGZ79kaeWa5PRregdoJp82sSsY1-GF7kk33fxf1kbTPcZWu-bg@mail.gmail.com","threadId":"49402","inReplyTo":"7f77be2b-a084-5b8d-df65-1bb4b9c5da82@gmail.com","subject":"Re: [PATCH 1/3] t7001: reformat to newer style","fromName":"Stefan Beller","fromEmail":"sbeller@google.com","sentAt":"2018-09-24T18:51:27Z","receivedAt":"2018-09-24T18:51:41Z","isPatch":true,"sender":{"key":"stefanbeller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/455868?v=4"},"body":"On Mon, Sep 24, 2018 at 6:31 AM Derrick Stolee <stolee@gmail.com> wrote:\n>\n> On 9/21/2018 7:58 PM, Stefan Beller wrote:\n> > The old formatting style is a real hindrance of getting people up to speed\n> > contributing as they use existing code as an example and follow that style.\n> > So let's get rid of the old style and reformat it in our current style.\n> I was suspicious of your automated approach catching everything, so I\n> looked carefully at this patch. There are still a lot of things\n> happening that we would not recommend doing in new tests.\n\nHeh, thanks for calling that out. So we're looking at a full formatter\ninstead of a partial formatter that helps moving in the right direction now. :-/\n\nI would prefer to use automation as much as possible for these tasks\nto keep it easy to apply it at scale once a file is not touched by\nmaster..pu any more.\n\nWhen applying styles manually, there is sometimes a judgement call,\nwhich would like to the inevitable bikeshedding that I'd prefer to avoid.\n\n> > +test_expect_success 'moving the file out of subdirectory' '\n> > +     cd path0 && git mv COPYING ../path1/COPYING\n> > +'\n> Perhaps split this line on the &&?\n\nIn real modern testing, this could also be\n\n    git -C path0 mv ...\n\nwhich would also fix the cd.. below and not needing\na subshell there either (using -C again).\n\nLooking at this from a higher level, nowadays I would write\ntests that have more lines in them, instead of having\none git command per test.\n\n> > +test_expect_success 'moving to existing tracked target with trailing slash' '\n> > +     mkdir path2 &&\n> > +     >path2/file && git add path2/file &&\n> This line in particular looks a bit strange. What is this doing? At\n> least we should split the &&.\n\nYes.\n\n> > +test_expect_success 'do not move directory over existing directory' '\n> > +     mkdir path0 && mkdir path0/path2 && test_must_fail git mv path2 path0\n> > +'\n>\n> Split this line.\n\nOkay, I'll go manually over these tests to adapt to new style.\n\nThanks for looking over the patch!\nStefan\n"},{"id":"358869","messageId":"xmqqd0t1pb4t.fsf@gitster-ct.c.googlers.com","threadId":"49402","inReplyTo":"CAGZ79kaeWa5PRregdoJp82sSsY1-GF7kk33fxf1kbTPcZWu-bg@mail.gmail.com","subject":"Re: [PATCH 1/3] t7001: reformat to newer style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-25T20:36:50Z","receivedAt":"2018-09-25T20:36:55Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stefan Beller <sbeller@google.com> writes:\n\n> Heh, thanks for calling that out. So we're looking at a full formatter\n> instead of a partial formatter that helps moving in the right direction now. :-/\n\nThe parts left out of these patches (e.g. use subshell when working\nin a subdirectory) need human decision and a bit of good taste, and\nI think it was a good design decision to keep these three patches\nall mechanical.  There do need a follow-up [PATCH {4,5,6}/3] that\ncannot be done mechanically, though, before the result can be called\n\"this script has been cleaned up and new people are encouraged to\nmimick the way it does things\".  \n\nThat way, we can keep the mechanically good bits that are early in\nthe series while polishing the later bits that need human judgement.\n\n\n"}]}