{"thread":{"id":"61915","subject":"[PATCH v5 0/8] [Newcomer] t7004: modernize the style","startedAt":"2024-08-07T13:03:29Z","lastAt":"2024-08-08T16:18:49Z","messageCount":12,"participants":["AbdAlRahman Gad","Junio C Hamano"],"isPatch":true,"patchVersion":5,"patchTotal":8},"messages":[{"id":"500312","messageId":"20240807130259.28381-1-abdobngad@gmail.com","threadId":"61915","inReplyTo":null,"subject":"[PATCH v5 0/8] [Newcomer] t7004: modernize the style","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:36Z","receivedAt":"2024-08-07T13:03:29Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"- Remove whitespace after the redirect operators.\n\n- Move number of expect files prepared outside of\n  test_expect_success to be inside the tests that use it.\n\n- Split some lines that have two commands into two lines\n  one command each.\n\n- Turn some \"<<\\EOF\" into \"<<-\\EOF\" and indent their body.\n\n- Avoid using pipes in the output from \"test-tool ref-store\"\n  and write the output to a file.\n\n- Change test_expect_success that are seperated from its name\n  to be on the same line.\n\n- Avoid separating test Description and test body with backslash\n\n- Use single quotes instead of double quotes for test description and\n  body.\n\n- Use write_script which takes care of emitting the `#!/bin/sh` line\n  and the `chmod +x`.\n\nThere are still tests that could lose exit status to pipe. This needs\nto be modernized too, I will fix them in another patch series.\n\nAbdAlRahman Gad (8):\n  t7004: remove space after redirect operators\n  t7004: one command per line\n  t7004: do not prepare things outside test_expect_success\n  t7004: use indented here-doc\n  t7004: description on the same line as test_expect_success\n  t7004: test Description and test body seperated with backslash\n  t7004: use single quotes instead of double quotes\n  t7004: make use of write_script\n\n t/t7004-tag.sh | 1144 +++++++++++++++++++++++-------------------------\n 1 file changed, 549 insertions(+), 595 deletions(-)\n\n\nbase-commit: 406f326d271e0bacecdb00425422c5fa3f314930\n-- \n2.43.0\n\n"},{"id":"500313","messageId":"20240807130259.28381-2-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 1/8] t7004: remove space after redirect operators","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:37Z","receivedAt":"2024-08-07T13:03:30Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Modernize 't7004' by removing whitespace after redirect operators.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 50 +++++++++++++++++++++++++-------------------------\n 1 file changed, 25 insertions(+), 25 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex fa6336edf9..3100a4c219 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -213,9 +213,9 @@ mytag\n EOF\n test_expect_success \\\n \t'trying to delete tags without params should succeed and do nothing' '\n-\tgit tag -l > actual && test_cmp expect actual &&\n+\tgit tag -l >actual && test_cmp expect actual &&\n \tgit tag -d &&\n-\tgit tag -l > actual && test_cmp expect actual\n+\tgit tag -l >actual && test_cmp expect actual\n '\n \n test_expect_success \\\n@@ -269,9 +269,9 @@ test_expect_success 'listing all tags should print them ordered' '\n \tgit tag a1 &&\n \tgit tag v1.0 &&\n \tgit tag t210 &&\n-\tgit tag -l > actual &&\n+\tgit tag -l >actual &&\n \ttest_cmp expect actual &&\n-\tgit tag > actual &&\n+\tgit tag >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -283,7 +283,7 @@ EOF\n test_expect_success \\\n \t'listing tags with substring as pattern must print those matching' '\n \trm *a* &&\n-\tgit tag -l \"*a*\" > current &&\n+\tgit tag -l \"*a*\" >current &&\n \ttest_cmp expect current\n '\n \n@@ -293,7 +293,7 @@ v1.0.1\n EOF\n test_expect_success \\\n \t'listing tags with a suffix as pattern must print those matching' '\n-\tgit tag -l \"*.1\" > actual &&\n+\tgit tag -l \"*.1\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -303,7 +303,7 @@ t211\n EOF\n test_expect_success \\\n \t'listing tags with a prefix as pattern must print those matching' '\n-\tgit tag -l \"t21*\" > actual &&\n+\tgit tag -l \"t21*\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -312,7 +312,7 @@ a1\n EOF\n test_expect_success \\\n \t'listing tags using a name as pattern must print that one matching' '\n-\tgit tag -l a1 > actual &&\n+\tgit tag -l a1 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -321,7 +321,7 @@ v1.0\n EOF\n test_expect_success \\\n \t'listing tags using a name as pattern must print that one matching' '\n-\tgit tag -l v1.0 > actual &&\n+\tgit tag -l v1.0 >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -331,13 +331,13 @@ v1.1.3\n EOF\n test_expect_success \\\n \t'listing tags with ? in the pattern should print those matching' '\n-\tgit tag -l \"v1.?.?\" > actual &&\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-\tgit tag -l \"v.*\" > actual &&\n+\tgit tag -l \"v.*\" >actual &&\n \ttest_must_be_empty actual\n '\n \n@@ -349,7 +349,7 @@ v1.1.3\n EOF\n test_expect_success \\\n \t'listing tags using v* should print only those having v' '\n-\tgit tag -l \"v*\" > actual &&\n+\tgit tag -l \"v*\" >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -1171,7 +1171,7 @@ test_expect_success GPG \\\n \tgit tag -v emptyfile-signed-tag\n '\n \n-printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' > sigblanksfile\n+printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' >sigblanksfile\n printf '\\n\\t \\t  \\nRepeated blank lines\\n' >>sigblanksfile\n printf '\\n\\n\\nTrailing spaces      \\t  \\n' >>sigblanksfile\n printf '\\nTrailing blank lines\\n\\n\\t \\n\\n' >>sigblanksfile\n@@ -1569,7 +1569,7 @@ test_expect_success \\\n \n test_expect_success \\\n \t'message in editor has initial comment' '\n-\t! (GIT_EDITOR=cat git tag -a initial-comment > actual)\n+\t! (GIT_EDITOR=cat git tag -a initial-comment >actual)\n '\n \n test_expect_success 'message in editor has initial comment: first line' '\n@@ -1587,7 +1587,7 @@ test_expect_success \\\n '\n \n get_tag_header reuse $commit commit $time >expect\n-echo \"An annotation to be reused\" >> expect\n+echo \"An annotation to be reused\" >>expect\n test_expect_success \\\n \t'overwriting an annotated tag should use its previous body' '\n \tgit tag -a -m \"An annotation to be reused\" reuse &&\n@@ -1639,7 +1639,7 @@ hash3=$(git rev-parse HEAD)\n \n # simple linear checks of --continue\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n@@ -1679,7 +1679,7 @@ test_expect_success 'checking that first commit is in all tags (relative)' \"\n \ttest_must_be_empty actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v2.0\n EOF\n \n@@ -1688,7 +1688,7 @@ test_expect_success 'checking that second commit only has one tag' \"\n \ttest_cmp expected actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n@@ -1705,7 +1705,7 @@ test_expect_success 'checking that third commit has no tags' \"\n \ttest_must_be_empty actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n@@ -1723,14 +1723,14 @@ test_expect_success 'conversely --no-contains on the third commit lists all tags\n test_expect_success 'creating simple branch' '\n \tgit branch stable v2.0 &&\n         git checkout stable &&\n-\techo foo-3.0 > foo &&\n+\techo foo-3.0 >foo &&\n \tgit commit foo -m fourth &&\n \tgit tag v3.0\n '\n \n hash4=$(git rev-parse HEAD)\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v3.0\n EOF\n \n@@ -1739,7 +1739,7 @@ test_expect_success 'checking that branch head only has one tag' \"\n \ttest_cmp expected actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n@@ -1757,7 +1757,7 @@ test_expect_success 'merging original branch into this branch' '\n         git tag v4.0\n '\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v4.0\n EOF\n \n@@ -1766,7 +1766,7 @@ test_expect_success 'checking that original branch head has one tag now' \"\n \ttest_cmp expected actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n@@ -1780,7 +1780,7 @@ test_expect_success 'checking that original branch head with --no-contains lists\n \ttest_cmp expected actual\n \"\n \n-cat > expected <<EOF\n+cat >expected <<EOF\n v0.2.1\n v1.0\n v1.0.1\n-- \n2.43.0\n\n"},{"id":"500314","messageId":"20240807130259.28381-3-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 2/8] t7004: one command per line","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:38Z","receivedAt":"2024-08-07T13:03:32Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"One of the tests in t7004 has multiple commands on a single line,\nwhich is discouraged. Adapt these by splitting up these into one\nline per command.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 3100a4c219..09ce287559 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -213,9 +213,11 @@ mytag\n EOF\n test_expect_success \\\n \t'trying to delete tags without params should succeed and do nothing' '\n-\tgit tag -l >actual && test_cmp expect actual &&\n+\tgit tag -l >actual &&\n+\ttest_cmp expect actual &&\n \tgit tag -d &&\n-\tgit tag -l >actual && test_cmp expect actual\n+\tgit tag -l >actual &&\n+\ttest_cmp expect actual\n '\n \n test_expect_success \\\n-- \n2.43.0\n\n"},{"id":"500315","messageId":"20240807130259.28381-5-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 4/8] t7004: use indented here-doc","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:40Z","receivedAt":"2024-08-07T13:03:33Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Use <<-\\EOF instead of <<\\EOF where the latter allows us to indent\nthe body of the here-doc.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 38 +++++++++++++++++++-------------------\n 1 file changed, 19 insertions(+), 19 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex a755d3be00..996020fd7c 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -387,10 +387,10 @@ test_expect_success 'tag -l <pattern> -l <pattern> works, as our buggy documenta\n \n test_expect_success 'listing tags in column' '\n \tCOLUMNS=41 git tag -l --column=row >actual &&\n-\tcat >expected <<\\EOF &&\n-a1      aa1     cba     t210    t211\n-v0.2.1  v1.0    v1.0.1  v1.1.3\n-EOF\n+\tcat >expected <<-\\EOF &&\n+\ta1      aa1     cba     t210    t211\n+\tv0.2.1  v1.0    v1.0.1  v1.1.3\n+\tEOF\n \ttest_cmp expected actual\n '\n \n@@ -398,10 +398,10 @@ test_expect_success 'listing tags in column with column.*' '\n \ttest_config column.tag row &&\n \ttest_config column.ui dense &&\n \tCOLUMNS=40 git tag -l >actual &&\n-\tcat >expected <<\\EOF &&\n-a1      aa1   cba     t210    t211\n-v0.2.1  v1.0  v1.0.1  v1.1.3\n-EOF\n+\tcat >expected <<-\\EOF &&\n+\ta1      aa1   cba     t210    t211\n+\tv0.2.1  v1.0  v1.0.1  v1.1.3\n+\tEOF\n \ttest_cmp expected actual\n '\n \n@@ -412,17 +412,17 @@ test_expect_success 'listing tag with -n --column should fail' '\n test_expect_success 'listing tags -n in column with column.ui ignored' '\n \ttest_config column.ui \"row dense\" &&\n \tCOLUMNS=40 git tag -l -n >actual &&\n-\tcat >expected <<\\EOF &&\n-a1              Foo\n-aa1             Foo\n-cba             Foo\n-t210            Foo\n-t211            Foo\n-v0.2.1          Foo\n-v1.0            Foo\n-v1.0.1          Foo\n-v1.1.3          Foo\n-EOF\n+\tcat >expected <<-\\EOF &&\n+\ta1              Foo\n+\taa1             Foo\n+\tcba             Foo\n+\tt210            Foo\n+\tt211            Foo\n+\tv0.2.1          Foo\n+\tv1.0            Foo\n+\tv1.0.1          Foo\n+\tv1.1.3          Foo\n+\tEOF\n \ttest_cmp expected actual\n '\n \n-- \n2.43.0\n\n"},{"id":"500316","messageId":"20240807130259.28381-4-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 3/8] t7004: do not prepare things outside test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:39Z","receivedAt":"2024-08-07T13:03:33Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Do not prepare expect and other things outside test_expect_success.\nIf such code fails for some reason, we won't necessarily hear about\nit in a timely fashion (or perhaps at all). By placing all code inside\n`test_expect_success` it ensures that we know immediately if it fails.\n\nAlso add '\\' before EOF to avoid shell interpolation and '-' to allow\nindentation of the body.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 698 +++++++++++++++++++++++++------------------------\n 1 file changed, 360 insertions(+), 338 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 09ce287559..a755d3be00 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -129,10 +129,10 @@ test_expect_success 'listing all tags if one exists should succeed' '\n \tgit tag\n '\n \n-cat >expect <<EOF\n-mytag\n-EOF\n test_expect_success 'Multiple -l or --list options are equivalent to one -l option' '\n+\tcat >expect <<-\\EOF &&\n+\tmytag\n+\tEOF\n \tgit tag -l -l >actual &&\n \ttest_cmp expect actual &&\n \tgit tag --list --list >actual &&\n@@ -207,12 +207,12 @@ test_expect_success 'trying to delete an unknown tag should fail' '\n \ttest_must_fail git tag -d unknown-tag\n '\n \n-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+\tcat >expect <<-\\EOF &&\n+\tmyhead\n+\tmytag\n+\tEOF\n \tgit tag -l >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -d &&\n@@ -250,18 +250,18 @@ test_expect_success 'trying to delete an already deleted tag should fail' \\\n \n # listing various tags with pattern matching:\n \n-cat >expect <<EOF\n-a1\n-aa1\n-cba\n-t210\n-t211\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-EOF\n test_expect_success 'listing all tags should print them ordered' '\n+\tcat >expect <<-\\EOF &&\n+\ta1\n+\taa1\n+\tcba\n+\tt210\n+\tt211\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag v1.0.1 &&\n \tgit tag t211 &&\n \tgit tag aa1 &&\n@@ -277,62 +277,62 @@ test_expect_success 'listing all tags should print them ordered' '\n \ttest_cmp expect actual\n '\n \n-cat >expect <<EOF\n-a1\n-aa1\n-cba\n-EOF\n test_expect_success \\\n \t'listing tags with substring as pattern must print those matching' '\n+\tcat >expect <<-\\EOF &&\n+\ta1\n+\taa1\n+\tcba\n+\tEOF\n \trm *a* &&\n \tgit tag -l \"*a*\" >current &&\n \ttest_cmp expect current\n '\n \n-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+\tcat >expect <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0.1\n+\tEOF\n \tgit tag -l \"*.1\" >actual &&\n \ttest_cmp expect actual\n '\n \n-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+\tcat >expect <<-\\EOF &&\n+\tt210\n+\tt211\n+\tEOF\n \tgit tag -l \"t21*\" >actual &&\n \ttest_cmp expect actual\n '\n \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+\tcat >expect <<-\\EOF &&\n+\ta1\n+\tEOF\n \tgit tag -l a1 >actual &&\n \ttest_cmp expect actual\n '\n \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+\tcat >expect <<-\\EOF &&\n+\tv1.0\n+\tEOF\n \tgit tag -l v1.0 >actual &&\n \ttest_cmp expect actual\n '\n \n-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+\tcat >expect <<-\\EOF &&\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag -l \"v1.?.?\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -343,19 +343,25 @@ test_expect_success \\\n \ttest_must_be_empty actual\n '\n \n-cat >expect <<EOF\n-v0.2.1\n-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+\tcat >expect <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag -l \"v*\" >actual &&\n \ttest_cmp expect actual\n '\n \n test_expect_success 'tag -l can accept multiple patterns' '\n+\tcat >expect <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag -l \"v1*\" \"v0*\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -369,6 +375,12 @@ test_expect_success 'tag -l can accept multiple patterns' '\n # out if we're going to break this long-documented form of taking\n # multiple patterns.\n test_expect_success 'tag -l <pattern> -l <pattern> works, as our buggy documentation previously suggested' '\n+\tcat >expect <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag -l \"v1*\" -l \"v0*\" >actual &&\n \ttest_cmp expect actual\n '\n@@ -451,68 +463,69 @@ tagger C O Mitter <committer@example.com> $4 -0700\n EOF\n }\n \n-commit=$(git rev-parse HEAD)\n-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+\tcommit=$(git rev-parse HEAD) &&\n+\ttime=$test_tick &&\n+\tget_tag_header annotated-tag $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n \tgit tag -m \"A message\" annotated-tag &&\n \tget_tag_msg annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header annotated-tag-edit $commit commit $time >expect\n-echo \"An edited message\" >>expect\n test_expect_success 'set up editor' '\n \twrite_script fakeeditor <<-\\EOF\n \tsed -e \"s/A message/An edited message/g\" <\"$1\" >\"$1-\"\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n+\n test_expect_success \\\n \t'creating an annotated tag with -m message --edit should succeed' '\n+\tget_tag_header annotated-tag-edit $commit commit $time >expect &&\n+\techo \"An edited message\" >>expect &&\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 '\n \n-cat >msgfile <<EOF\n-Another message\n-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+\tcat >msgfile <<-\\EOF &&\n+\tAnother message\n+\tin a file.\n+\tEOF\n+\tget_tag_header file-annotated-tag $commit commit $time >expect &&\n+\tcat msgfile >>expect &&\n \tgit tag -F msgfile file-annotated-tag &&\n \tget_tag_msg file-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header file-annotated-tag-edit $commit commit $time >expect\n-sed -e \"s/Another message/Another edited message/g\" msgfile >>expect\n test_expect_success 'set up editor' '\n \twrite_script fakeeditor <<-\\EOF\n \tsed -e \"s/Another message/Another edited message/g\" <\"$1\" >\"$1-\"\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n+\n test_expect_success \\\n \t'creating an annotated tag with -F messagefile --edit should succeed' '\n+\tget_tag_header file-annotated-tag-edit $commit commit $time >expect &&\n+\tsed -e \"s/Another message/Another edited message/g\" msgfile >>expect &&\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 '\n \n-cat >inputmsg <<EOF\n-A message from the\n-standard input\n-EOF\n-get_tag_header stdin-annotated-tag $commit commit $time >expect\n-cat inputmsg >>expect\n test_expect_success 'creating an annotated tag with -F - should succeed' '\n+\tcat >inputmsg <<-\\EOF &&\n+\tA message from the\n+\tstandard input\n+\tEOF\n+\tget_tag_header stdin-annotated-tag $commit commit $time >expect &&\n+\tcat inputmsg >>expect &&\n \tgit tag -F - stdin-annotated-tag <inputmsg &&\n \tget_tag_msg stdin-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -541,67 +554,67 @@ test_expect_success \\\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+\tget_tag_header empty-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"\" empty-annotated-tag &&\n \tget_tag_msg empty-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\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+\t>emptyfile &&\n+\tget_tag_header emptyfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F emptyfile emptyfile-annotated-tag &&\n \tget_tag_msg emptyfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' >blanksfile\n-printf '\\n\\t \\t  \\nRepeated blank lines\\n' >>blanksfile\n-printf '\\n\\n\\nTrailing spaces      \\t  \\n' >>blanksfile\n-printf '\\nTrailing blank lines\\n\\n\\t \\n\\n' >>blanksfile\n-get_tag_header blanks-annotated-tag $commit commit $time >expect\n-cat >>expect <<EOF\n-Leading blank lines\n+test_expect_success \\\n+\t'extra blanks in the message for an annotated tag should be removed' '\n+\tprintf \"\\n\\n  \\n\\t\\nLeading blank lines\\n\" >blanksfile &&\n+\tprintf \"\\n\\t \\t  \\nRepeated blank lines\\n\" >>blanksfile &&\n+\tprintf \"\\n\\n\\nTrailing spaces      \\t  \\n\" >>blanksfile &&\n+\tprintf \"\\nTrailing blank lines\\n\\n\\t \\n\\n\" >>blanksfile &&\n+\tget_tag_header blanks-annotated-tag $commit commit $time >expect &&\n+\tcat >>expect <<-\\EOF &&\n+\tLeading blank lines\n \n-Repeated blank lines\n+\tRepeated blank lines\n \n-Trailing spaces\n+\tTrailing 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+\tTrailing blank lines\n+\tEOF\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+\tget_tag_header blank-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"     \" blank-annotated-tag &&\n \tget_tag_msg blank-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-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+\techo \"     \" >blankfile &&\n+\techo \"\"      >>blankfile &&\n+\techo \"  \"    >>blankfile &&\n+\tget_tag_header blankfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F blankfile blankfile-annotated-tag &&\n \tget_tag_msg blankfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\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+\tprintf \"      \" >blanknonlfile &&\n+\tget_tag_header blanknonlfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n \tget_tag_msg blanknonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -609,62 +622,62 @@ test_expect_success \\\n \n # messages with commented lines:\n \n-cat >commentsfile <<EOF\n-# A comment\n+test_expect_success \\\n+\t'creating a tag using a -F messagefile with #comments should succeed' '\n+\tcat >commentsfile <<-\\EOF &&\n+\t# A comment\n \n-############\n-The message.\n-############\n-One line.\n+\t############\n+\tThe message.\n+\t############\n+\tOne line.\n \n \n-# commented lines\n-# commented lines\n+\t# commented lines\n+\t# commented lines\n \n-Another line.\n-# comments\n+\tAnother line.\n+\t# comments\n \n-Last line.\n-EOF\n-get_tag_header comments-annotated-tag $commit commit $time >expect\n-cat >>expect <<EOF\n-The message.\n-One line.\n+\tLast line.\n+\tEOF\n+\tget_tag_header comments-annotated-tag $commit commit $time >expect &&\n+\tcat >>expect <<-\\EOF &&\n+\tThe message.\n+\tOne line.\n \n-Another line.\n+\tAnother 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+\tLast line.\n+\tEOF\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+\tget_tag_header comment-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"#comment\" comment-annotated-tag &&\n \tget_tag_msg comment-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-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+\techo \"#comment\" >commentfile &&\n+\techo \"\"         >>commentfile &&\n+\techo \"####\"     >>commentfile &&\n+\tget_tag_header commentfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F commentfile commentfile-annotated-tag &&\n \tget_tag_msg commentfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\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+\tprintf \"#comment\" >commentnonlfile &&\n+\tget_tag_header commentnonlfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F commentnonlfile commentnonlfile-annotated-tag &&\n \tget_tag_msg commentnonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -846,11 +859,11 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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+\techo \"tag line one\" >annotagmsg &&\n+\techo \"tag line two\" >>annotagmsg &&\n+\techo \"tag line three\" >>annotagmsg  &&\n \tgit tag -F annotagmsg tag-lines &&\n \n \techo \"tag-lines\" >expect &&\n@@ -958,20 +971,20 @@ test_expect_success GPG \\\n \n # creating and verifying signed tags:\n \n-get_tag_header signed-tag $commit commit $time >expect\n-echo 'A signed tag message' >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG 'creating a signed tag with -m message should succeed' '\n+\tget_tag_header signed-tag $commit commit $time >expect &&\n+\techo \"A signed tag message\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"A signed tag message\" signed-tag &&\n \tget_tag_msg signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header u-signed-tag $commit commit $time >expect\n-echo 'Another message' >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG 'sign with a given key id' '\n \n+\tget_tag_header u-signed-tag $commit commit $time >expect &&\n+\techo \"Another message\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -u committer@example.com -m \"Another message\" u-signed-tag &&\n \tget_tag_msg u-signed-tag >actual &&\n \ttest_cmp expect actual\n@@ -991,65 +1004,65 @@ test_expect_success GPG 'sign with an unknown id (2)' '\n \n '\n \n-cat >fakeeditor <<'EOF'\n-#!/bin/sh\n-test -n \"$1\" && exec >\"$1\"\n-echo A signed tag message\n-echo from a fake editor.\n-EOF\n-chmod +x fakeeditor\n-\n-get_tag_header implied-sign $commit commit $time >expect\n-./fakeeditor >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG '-u implies signed tag' '\n+\tcat >fakeeditor <<-\\EOF &&\n+\t#!/bin/sh\n+\ttest -n \"$1\" && exec >\"$1\"\n+\techo A signed tag message\n+\techo from a fake editor.\n+\tEOF\n+\tchmod +x fakeeditor &&\n+\n+\tget_tag_header implied-sign $commit commit $time >expect &&\n+\t./fakeeditor >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tGIT_EDITOR=./fakeeditor git tag -u CDDE430D implied-sign &&\n \tget_tag_msg implied-sign >actual &&\n \ttest_cmp expect actual\n '\n \n-cat >sigmsgfile <<EOF\n-Another signed tag\n-message in a file.\n-EOF\n-get_tag_header file-signed-tag $commit commit $time >expect\n-cat sigmsgfile >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with -F messagefile should succeed' '\n+\tcat >sigmsgfile <<-\\EOF &&\n+\tAnother signed tag\n+\tmessage in a file.\n+\tEOF\n+\tget_tag_header file-signed-tag $commit commit $time >expect &&\n+\tcat sigmsgfile >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigmsgfile file-signed-tag &&\n \tget_tag_msg file-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-cat >siginputmsg <<EOF\n-A signed tag message from\n-the standard input\n-EOF\n-get_tag_header stdin-signed-tag $commit commit $time >expect\n-cat siginputmsg >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG 'creating a signed tag with -F - should succeed' '\n+\tcat >siginputmsg <<-\\EOF &&\n+\tA signed tag message from\n+\tthe standard input\n+\tEOF\n+\tget_tag_header stdin-signed-tag $commit commit $time >expect &&\n+\tcat siginputmsg >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F - stdin-signed-tag <siginputmsg &&\n \tget_tag_msg stdin-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header implied-annotate $commit commit $time >expect\n-./fakeeditor >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG '-s implies annotated tag' '\n+\tget_tag_header implied-annotate $commit commit $time >expect &&\n+\t./fakeeditor >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tGIT_EDITOR=./fakeeditor git tag -s implied-annotate &&\n \tget_tag_msg implied-annotate >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header forcesignannotated-implied-sign $commit commit $time >expect\n-echo \"A message\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'git tag -s implied if configured with tag.forcesignannotated' \\\n-\t'test_config tag.forcesignannotated true &&\n+\t'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n+\ttest_config tag.forcesignannotated true &&\n \tgit tag -m \"A message\" forcesignannotated-implied-sign &&\n \tget_tag_msg forcesignannotated-implied-sign >actual &&\n \ttest_cmp expect actual\n@@ -1063,44 +1076,44 @@ test_expect_success GPG \\\n \ttest_must_fail git tag -v forcesignannotated-no-message\n '\n \n-get_tag_header forcesignannotated-annotate $commit commit $time >expect\n-echo \"A message\" >>expect\n test_expect_success GPG \\\n \t'git tag -a disable configured tag.forcesignannotated' \\\n-\t'test_config tag.forcesignannotated true &&\n+\t'get_tag_header forcesignannotated-annotate $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n+\ttest_config tag.forcesignannotated true &&\n \tgit tag -a -m \"A message\" forcesignannotated-annotate &&\n \tget_tag_msg forcesignannotated-annotate >actual &&\n \ttest_cmp expect actual &&\n \ttest_must_fail git tag -v forcesignannotated-annotate\n '\n \n-get_tag_header forcesignannotated-disabled $commit commit $time >expect\n-echo \"A message\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'git tag --sign enable GPG sign' \\\n-\t'test_config tag.forcesignannotated false &&\n+\t'get_tag_header forcesignannotated-disabled $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n+\ttest_config tag.forcesignannotated false &&\n \tgit tag --sign -m \"A message\" forcesignannotated-disabled &&\n \tget_tag_msg forcesignannotated-disabled >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header gpgsign-enabled $commit commit $time >expect\n-echo \"A message\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'git tag configured tag.gpgsign enables GPG sign' \\\n-\t'test_config tag.gpgsign true &&\n+\t'get_tag_header gpgsign-enabled $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n+\ttest_config tag.gpgsign true &&\n \tgit tag -m \"A message\" gpgsign-enabled &&\n \tget_tag_msg gpgsign-enabled>actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header no-sign $commit commit $time >expect\n-echo \"A message\" >>expect\n test_expect_success GPG \\\n \t'git tag --no-sign configured tag.gpgsign skip GPG sign' \\\n-\t'test_config tag.gpgsign true &&\n+\t'get_tag_header no-sign $commit commit $time >expect &&\n+\techo \"A message\" >>expect &&\n+\ttest_config tag.gpgsign true &&\n \tgit tag -a --no-sign -m \"A message\" no-sign &&\n \tget_tag_msg no-sign>actual &&\n \ttest_cmp expect actual\n@@ -1152,78 +1165,78 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent\n \n # blank and empty messages for signed tags:\n \n-get_tag_header empty-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with an empty -m message should succeed' '\n+\tget_tag_header empty-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"\" empty-signed-tag &&\n \tget_tag_msg empty-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v empty-signed-tag\n '\n \n->sigemptyfile\n-get_tag_header emptyfile-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with an empty -F messagefile should succeed' '\n+\t>sigemptyfile &&\n+\tget_tag_header emptyfile-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigemptyfile emptyfile-signed-tag &&\n \tget_tag_msg emptyfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v emptyfile-signed-tag\n '\n \n-printf '\\n\\n  \\n\\t\\nLeading blank lines\\n' >sigblanksfile\n-printf '\\n\\t \\t  \\nRepeated blank lines\\n' >>sigblanksfile\n-printf '\\n\\n\\nTrailing spaces      \\t  \\n' >>sigblanksfile\n-printf '\\nTrailing blank lines\\n\\n\\t \\n\\n' >>sigblanksfile\n-get_tag_header blanks-signed-tag $commit commit $time >expect\n-cat >>expect <<EOF\n-Leading blank lines\n+test_expect_success GPG \\\n+\t'extra blanks in the message for a signed tag should be removed' '\n+\tprintf \"\\n\\n  \\n\\t\\nLeading blank lines\\n\" >sigblanksfile &&\n+\tprintf \"\\n\\t \\t  \\nRepeated blank lines\\n\" >>sigblanksfile &&\n+\tprintf \"\\n\\n\\nTrailing spaces      \\t  \\n\" >>sigblanksfile &&\n+\tprintf \"\\nTrailing blank lines\\n\\n\\t \\n\\n\" >>sigblanksfile &&\n+\tget_tag_header blanks-signed-tag $commit commit $time >expect &&\n+\tcat >>expect <<-\\EOF &&\n+\tLeading blank lines\n \n-Repeated blank lines\n+\tRepeated blank lines\n \n-Trailing spaces\n+\tTrailing spaces\n \n-Trailing blank lines\n-EOF\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success GPG \\\n-\t'extra blanks in the message for a signed tag should be removed' '\n+\tTrailing blank lines\n+\tEOF\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigblanksfile blanks-signed-tag &&\n \tget_tag_msg blanks-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v blanks-signed-tag\n '\n \n-get_tag_header blank-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with a blank -m message should succeed' '\n+\tget_tag_header blank-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"     \" blank-signed-tag &&\n \tget_tag_msg blank-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v blank-signed-tag\n '\n \n-echo '     ' >sigblankfile\n-echo ''      >>sigblankfile\n-echo '  '    >>sigblankfile\n-get_tag_header blankfile-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with blank -F file with spaces should succeed' '\n+\techo \"     \" >sigblankfile &&\n+\techo \"\"      >>sigblankfile &&\n+\techo \"  \"    >>sigblankfile &&\n+\tget_tag_header blankfile-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigblankfile blankfile-signed-tag &&\n \tget_tag_msg blankfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v blankfile-signed-tag\n '\n \n-printf '      ' >sigblanknonlfile\n-get_tag_header blanknonlfile-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with spaces and no newline should succeed' '\n+\tprintf \"      \" >sigblanknonlfile &&\n+\tget_tag_header blanknonlfile-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&\n \tget_tag_msg blanknonlfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1243,69 +1256,69 @@ test_expect_success GPG 'signed tag with embedded PGP message' '\n \n # messages with commented lines for signed tags:\n \n-cat >sigcommentsfile <<EOF\n-# A comment\n+test_expect_success GPG \\\n+\t'creating a signed tag with a -F file with #comments should succeed' '\n+\tcat >sigcommentsfile <<-\\EOF &&\n+\t# A comment\n \n-############\n-The message.\n-############\n-One line.\n+\t############\n+\tThe message.\n+\t############\n+\tOne line.\n \n \n-# commented lines\n-# commented lines\n+\t# commented lines\n+\t# commented lines\n \n-Another line.\n-# comments\n+\tAnother line.\n+\t# comments\n \n-Last line.\n-EOF\n-get_tag_header comments-signed-tag $commit commit $time >expect\n-cat >>expect <<EOF\n-The message.\n-One line.\n+\tLast line.\n+\tEOF\n+\tget_tag_header comments-signed-tag $commit commit $time >expect &&\n+\tcat >>expect <<-\\EOF &&\n+\tThe message.\n+\tOne line.\n \n-Another line.\n+\tAnother line.\n \n-Last line.\n-EOF\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n-test_expect_success GPG \\\n-\t'creating a signed tag with a -F file with #comments should succeed' '\n+\tLast line.\n+\tEOF\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigcommentsfile comments-signed-tag &&\n \tget_tag_msg comments-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v comments-signed-tag\n '\n \n-get_tag_header comment-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with #commented -m message should succeed' '\n+\tget_tag_header comment-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"#comment\" comment-signed-tag &&\n \tget_tag_msg comment-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v comment-signed-tag\n '\n \n-echo '#comment' >sigcommentfile\n-echo ''         >>sigcommentfile\n-echo '####'     >>sigcommentfile\n-get_tag_header commentfile-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with #commented -F messagefile should succeed' '\n+\techo \"#comment\" >sigcommentfile &&\n+\techo \"\"         >>sigcommentfile &&\n+\techo \"####\"     >>sigcommentfile &&\n+\tget_tag_header commentfile-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigcommentfile commentfile-signed-tag &&\n \tget_tag_msg commentfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n \tgit tag -v commentfile-signed-tag\n '\n \n-printf '#comment' >sigcommentnonlfile\n-get_tag_header commentnonlfile-signed-tag $commit commit $time >expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag with a #comment and no newline should succeed' '\n+\tprintf \"#comment\" >sigcommentnonlfile &&\n+\tget_tag_header commentnonlfile-signed-tag $commit commit $time >expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&\n \tget_tag_msg commentnonlfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1364,11 +1377,11 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-echo 'stag line one' >sigtagmsg\n-echo 'stag line two' >>sigtagmsg\n-echo 'stag line three' >>sigtagmsg\n test_expect_success GPG \\\n \t'listing many message lines of a signed tag should succeed' '\n+\techo \"stag line one\" >sigtagmsg &&\n+\techo \"stag line two\" >>sigtagmsg &&\n+\techo \"stag line three\" >>sigtagmsg &&\n \tgit tag -s -F sigtagmsg stag-lines &&\n \n \techo \"stag-lines\" >expect &&\n@@ -1410,60 +1423,59 @@ test_expect_success GPG \\\n \n # tags pointing to objects different from commits:\n \n-tree=$(git rev-parse HEAD^{tree})\n-blob=$(git rev-parse HEAD:foo)\n-tag=$(git rev-parse signed-tag 2>/dev/null)\n-\n-get_tag_header tree-signed-tag $tree tree $time >expect\n-echo \"A message for a tree\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag pointing to a tree should succeed' '\n+\ttree=$(git rev-parse HEAD^{tree}) &&\n+\tget_tag_header tree-signed-tag $tree tree $time >expect &&\n+\techo \"A message for a tree\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"A message for a tree\" tree-signed-tag HEAD^{tree} &&\n \tget_tag_msg tree-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header blob-signed-tag $blob blob $time >expect\n-echo \"A message for a blob\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag pointing to a blob should succeed' '\n+\tblob=$(git rev-parse HEAD:foo) &&\n+\tget_tag_header blob-signed-tag $blob blob $time >expect &&\n+\techo \"A message for a blob\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"A message for a blob\" blob-signed-tag HEAD:foo &&\n \tget_tag_msg blob-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-get_tag_header tag-signed-tag $tag tag $time >expect\n-echo \"A message for another tag\" >>expect\n-echo '-----BEGIN PGP SIGNATURE-----' >>expect\n test_expect_success GPG \\\n \t'creating a signed tag pointing to another tag should succeed' '\n+\ttag=$(git rev-parse signed-tag 2>/dev/null) &&\n+\tget_tag_header tag-signed-tag $tag tag $time >expect &&\n+\techo \"A message for another tag\" >>expect &&\n+\techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"A message for another tag\" tag-signed-tag signed-tag &&\n \tget_tag_msg tag-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n # usage with rfc1991 signatures\n-get_tag_header rfc1991-signed-tag $commit commit $time >expect\n-echo \"RFC1991 signed tag\" >>expect\n-echo '-----BEGIN PGP MESSAGE-----' >>expect\n+\n test_expect_success GPG,RFC1991 \\\n \t'creating a signed tag with rfc1991' '\n+\tget_tag_header rfc1991-signed-tag $commit commit $time >expect &&\n+\techo \"RFC1991 signed tag\" >>expect &&\n+\techo \"-----BEGIN PGP MESSAGE-----\" >>expect &&\n \techo \"rfc1991\" >gpghome/gpg.conf &&\n \tgit tag -s -m \"RFC1991 signed tag\" rfc1991-signed-tag $commit &&\n \tget_tag_msg rfc1991-signed-tag >actual &&\n \ttest_cmp expect actual\n '\n \n-cat >fakeeditor <<'EOF'\n-#!/bin/sh\n-cp \"$1\" actual\n-EOF\n-chmod +x fakeeditor\n-\n test_expect_success GPG,RFC1991 \\\n \t'reediting a signed tag body omits signature' '\n+\tcat >fakeeditor <<-\\EOF &&\n+\t#!/bin/sh\n+\tcp \"$1\" actual\n+\tEOF\n+\tchmod +x fakeeditor &&\n \techo \"rfc1991\" >gpghome/gpg.conf &&\n \techo \"RFC1991 signed tag\" >expect &&\n \tGIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&\n@@ -1488,10 +1500,9 @@ test_expect_success GPG,RFC1991 \\\n \ttest_cmp expect actual\n '\n \n-rm -f gpghome/gpg.conf\n-\n test_expect_success GPG,RFC1991 \\\n \t'verifying rfc1991 signature without --rfc1991' '\n+\trm -f gpghome/gpg.conf &&\n \tgit tag -v rfc1991-signed-tag\n '\n \n@@ -1559,10 +1570,11 @@ test_expect_success GPGSM \\\n \n # try to verify without gpg:\n \n-rm -rf gpghome\n 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+\t'rm -rf gpghome &&\n+\ttest_must_fail git tag -v signed-tag\n+'\n \n test_expect_success \\\n \t'git tag -a fails if tag annotation is empty' '\n@@ -1588,10 +1600,10 @@ test_expect_success \\\n \ttest_must_be_empty rest.actual\n '\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 annotated tag should use its previous body' '\n+\tget_tag_header reuse $commit commit $time >expect &&\n+\techo \"An annotation to be reused\" >>expect &&\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@@ -1620,47 +1632,57 @@ test_expect_success 'filename for the message is relative to cwd' '\n \n # create a few more commits to test --contains\n \n-hash1=$(git rev-parse HEAD)\n-\n test_expect_success 'creating second commit and tag' '\n+\thash1=$(git rev-parse HEAD) &&\n \techo foo-2.0 >foo &&\n \tgit add foo &&\n \tgit commit -m second &&\n \tgit tag v2.0\n '\n \n-hash2=$(git rev-parse HEAD)\n-\n test_expect_success 'creating third commit without tag' '\n+\thash2=$(git rev-parse HEAD) &&\n \techo foo-dev >foo &&\n \tgit add foo &&\n \tgit commit -m third\n '\n \n-hash3=$(git rev-parse HEAD)\n-\n # simple linear checks of --continue\n \n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-v2.0\n-EOF\n-\n test_expect_success 'checking that first commit is in all tags (hash)' \"\n+\thash3=$(git rev-parse HEAD) &&\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tEOF\n \tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n # other ways of specifying the commit\n test_expect_success 'checking that first commit is in all tags (tag)' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tEOF\n \tgit tag -l --contains v1.0 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n test_expect_success 'checking that first commit is in all tags (relative)' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tEOF\n \tgit tag -l --contains HEAD~2 v* >actual &&\n \ttest_cmp expected actual\n \"\n@@ -1681,23 +1703,21 @@ test_expect_success 'checking that first commit is in all tags (relative)' \"\n \ttest_must_be_empty actual\n \"\n \n-cat >expected <<EOF\n-v2.0\n-EOF\n-\n test_expect_success 'checking that second commit only has one tag' \"\n+\tcat >expected <<-\\EOF &&\n+\tv2.0\n+\tEOF\n \tgit tag -l --contains $hash2 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-EOF\n-\n test_expect_success 'inverse of the last test, with --no-contains' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tEOF\n \tgit tag -l --no-contains $hash2 v* >actual &&\n \ttest_cmp expected actual\n \"\n@@ -1707,15 +1727,14 @@ test_expect_success 'checking that third commit has no tags' \"\n \ttest_must_be_empty actual\n \"\n \n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-v2.0\n-EOF\n-\n test_expect_success 'conversely --no-contains on the third commit lists all tags' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tEOF\n \tgit tag -l --no-contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n \"\n@@ -1730,26 +1749,23 @@ test_expect_success 'creating simple branch' '\n \tgit tag v3.0\n '\n \n-hash4=$(git rev-parse HEAD)\n-\n-cat >expected <<EOF\n-v3.0\n-EOF\n-\n-test_expect_success 'checking that branch head only has one tag' \"\n+test_expect_success 'checking that branch head only has one tag' '\n+\thash4=$(git rev-parse HEAD) &&\n+\tcat >expected <<-\\EOF &&\n+\tv3.0\n+\tEOF\n \tgit tag -l --contains $hash4 v* >actual &&\n \ttest_cmp expected actual\n-\"\n-\n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-v2.0\n-EOF\n+'\n \n test_expect_success 'checking that branch head with --no-contains lists all but one tag' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tEOF\n \tgit tag -l --no-contains $hash4 v* >actual &&\n \ttest_cmp expected actual\n \"\n@@ -1759,45 +1775,51 @@ test_expect_success 'merging original branch into this branch' '\n         git tag v4.0\n '\n \n-cat >expected <<EOF\n-v4.0\n-EOF\n-\n test_expect_success 'checking that original branch head has one tag now' \"\n+\tcat >expected <<-\\EOF &&\n+\tv4.0\n+\tEOF\n \tgit tag -l --contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-v2.0\n-v3.0\n-EOF\n-\n test_expect_success 'checking that original branch head with --no-contains lists all but one tag now' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tv3.0\n+\tEOF\n \tgit tag -l --no-contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n-cat >expected <<EOF\n-v0.2.1\n-v1.0\n-v1.0.1\n-v1.1.3\n-v2.0\n-v3.0\n-v4.0\n-EOF\n-\n test_expect_success 'checking that initial commit is in all tags' \"\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tv3.0\n+\tv4.0\n+\tEOF\n \tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n \"\n \n test_expect_success 'checking that --contains can be used in non-list mode' '\n+\tcat >expected <<-\\EOF &&\n+\tv0.2.1\n+\tv1.0\n+\tv1.0.1\n+\tv1.1.3\n+\tv2.0\n+\tv3.0\n+\tv4.0\n+\tEOF\n \tgit tag --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n '\n-- \n2.43.0\n\n"},{"id":"500317","messageId":"20240807130259.28381-6-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 5/8] t7004: description on the same line as test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:41Z","receivedAt":"2024-08-07T13:03:34Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"There are several tests in t7004 where the test description that\nfollows `test_expect_success` is on a separate line, violating our\ncoding style. Adapt these to be on the same line.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 249 +++++++++++++++++--------------------------------\n 1 file changed, 83 insertions(+), 166 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 996020fd7c..5cbb13a603 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -154,26 +154,21 @@ 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+test_expect_success 'listing a tag using a matching pattern should output that tag' \\\n \t'test $(git tag -l mytag) = mytag'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should succeed' \\\n+test_expect_success 'listing tags using a non-matching pattern should succeed' \\\n \t'git tag -l xxx'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should output nothing' \\\n+test_expect_success 'listing tags using a non-matching pattern should output nothing' \\\n \t'test $(git tag -l xxx | wc -l) -eq 0'\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+test_expect_success 'trying to create a tag with the name of one existing should fail' \\\n \t'test_must_fail git tag mytag'\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@@ -207,8 +202,7 @@ test_expect_success 'trying to delete an unknown tag should fail' '\n \ttest_must_fail git tag -d unknown-tag\n '\n \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 \tcat >expect <<-\\EOF &&\n \tmyhead\n \tmytag\n@@ -220,8 +214,7 @@ test_expect_success \\\n \ttest_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@@ -229,15 +222,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 nonexistingtag &&\n \ttest_must_fail git tag -d mytag nonexistingtag &&\n@@ -277,8 +268,7 @@ test_expect_success 'listing all tags should print them ordered' '\n \ttest_cmp expect actual\n '\n \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 \tcat >expect <<-\\EOF &&\n \ta1\n \taa1\n@@ -289,8 +279,7 @@ test_expect_success \\\n \ttest_cmp expect current\n '\n \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 \tcat >expect <<-\\EOF &&\n \tv0.2.1\n \tv1.0.1\n@@ -299,8 +288,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tcat >expect <<-\\EOF &&\n \tt210\n \tt211\n@@ -309,8 +297,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tcat >expect <<-\\EOF &&\n \ta1\n \tEOF\n@@ -318,8 +305,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tcat >expect <<-\\EOF &&\n \tv1.0\n \tEOF\n@@ -327,8 +313,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tcat >expect <<-\\EOF &&\n \tv1.0.1\n \tv1.1.3\n@@ -337,14 +322,12 @@ test_expect_success \\\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 \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 \tcat >expect <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -428,8 +411,7 @@ test_expect_success 'listing tags -n in column with column.ui ignored' '\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@@ -438,12 +420,10 @@ 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+test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' \\\n \t'test_must_fail git tag -v non-annotated-tag'\n \n-test_expect_success \\\n-\t'trying to verify many non-annotated or unknown tags, should fail' \\\n+test_expect_success '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 \n # creating annotated tags:\n@@ -463,8 +443,7 @@ tagger C O Mitter <committer@example.com> $4 -0700\n EOF\n }\n \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 \tcommit=$(git rev-parse HEAD) &&\n \ttime=$test_tick &&\n \tget_tag_header annotated-tag $commit commit $time >expect &&\n@@ -481,8 +460,7 @@ test_expect_success 'set up editor' '\n \tEOF\n '\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 \tget_tag_header annotated-tag-edit $commit commit $time >expect &&\n \techo \"An edited message\" >>expect &&\n \tGIT_EDITOR=./fakeeditor git tag -m \"A message\" --edit annotated-tag-edit &&\n@@ -490,8 +468,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tcat >msgfile <<-\\EOF &&\n \tAnother message\n \tin a file.\n@@ -510,8 +487,7 @@ test_expect_success 'set up editor' '\n \tEOF\n '\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 \tget_tag_header file-annotated-tag-edit $commit commit $time >expect &&\n \tsed -e \"s/Another message/Another edited message/g\" msgfile >>expect &&\n \tGIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit &&\n@@ -531,16 +507,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 \t! tag_exists msgtag &&\n \ttest_must_fail git tag -m \"message 1\" -F msgfile1 msgtag &&\n@@ -554,16 +528,14 @@ test_expect_success \\\n \n # blank and empty messages:\n \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 \tget_tag_header empty-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"\" empty-annotated-tag &&\n \tget_tag_msg empty-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \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 \t>emptyfile &&\n \tget_tag_header emptyfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F emptyfile emptyfile-annotated-tag &&\n@@ -571,8 +543,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tprintf \"\\n\\n  \\n\\t\\nLeading blank lines\\n\" >blanksfile &&\n \tprintf \"\\n\\t \\t  \\nRepeated blank lines\\n\" >>blanksfile &&\n \tprintf \"\\n\\n\\nTrailing spaces      \\t  \\n\" >>blanksfile &&\n@@ -592,16 +563,14 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tget_tag_header blank-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"     \" blank-annotated-tag &&\n \tget_tag_msg blank-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \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 \techo \"     \" >blankfile &&\n \techo \"\"      >>blankfile &&\n \techo \"  \"    >>blankfile &&\n@@ -611,8 +580,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tprintf \"      \" >blanknonlfile &&\n \tget_tag_header blanknonlfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n@@ -622,8 +590,7 @@ test_expect_success \\\n \n # messages with commented lines:\n \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 \tcat >commentsfile <<-\\EOF &&\n \t# A comment\n \n@@ -655,16 +622,14 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tget_tag_header comment-annotated-tag $commit commit $time >expect &&\n \tgit tag -m \"#comment\" comment-annotated-tag &&\n \tget_tag_msg comment-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \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 \techo \"#comment\" >commentfile &&\n \techo \"\"         >>commentfile &&\n \techo \"####\"     >>commentfile &&\n@@ -674,8 +639,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \tprintf \"#comment\" >commentnonlfile &&\n \tget_tag_header commentnonlfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F commentnonlfile commentnonlfile-annotated-tag &&\n@@ -794,8 +758,7 @@ test_expect_success 'bad editor causes panic when only --trailer is given' '\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@@ -834,8 +797,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@@ -859,8 +821,7 @@ test_expect_success \\\n \ttest_cmp expect actual\n '\n \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 \techo \"tag line one\" >annotagmsg &&\n \techo \"tag line two\" >>annotagmsg &&\n \techo \"tag line three\" >>annotagmsg  &&\n@@ -951,20 +912,17 @@ test_expect_success 'git tag --format with ahead-behind' '\n \n # trying to verify annotated non-signed tags:\n \n-test_expect_success GPG \\\n-\t'trying to verify an annotated non-signed tag should fail' '\n+test_expect_success GPG 'trying to verify an annotated non-signed tag should fail' '\n \ttag_exists annotated-tag &&\n \ttest_must_fail git tag -v annotated-tag\n '\n \n-test_expect_success GPG \\\n-\t'trying to verify a file-annotated non-signed tag should fail' '\n+test_expect_success GPG 'trying to verify a file-annotated non-signed tag should fail' '\n \ttag_exists file-annotated-tag &&\n \ttest_must_fail git tag -v file-annotated-tag\n '\n \n-test_expect_success GPG \\\n-\t'trying to verify two annotated non-signed tags should fail' '\n+test_expect_success GPG 'trying to verify two annotated non-signed tags should fail' '\n \ttag_exists annotated-tag file-annotated-tag &&\n \ttest_must_fail git tag -v annotated-tag file-annotated-tag\n '\n@@ -1021,8 +979,7 @@ test_expect_success GPG '-u implies signed tag' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with -F messagefile should succeed' '\n+test_expect_success GPG 'creating a signed tag with -F messagefile should succeed' '\n \tcat >sigmsgfile <<-\\EOF &&\n \tAnother signed tag\n \tmessage in a file.\n@@ -1057,8 +1014,7 @@ test_expect_success GPG '-s implies annotated tag' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'git tag -s implied if configured with tag.forcesignannotated' \\\n+test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \\\n \t'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1068,16 +1024,14 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'lightweight with no message when configured with tag.forcesignannotated' \\\n+test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \\\n \t'test_config tag.forcesignannotated true &&\n \tgit tag forcesignannotated-lightweight &&\n \ttag_exists forcesignannotated-lightweight &&\n \ttest_must_fail git tag -v forcesignannotated-no-message\n '\n \n-test_expect_success GPG \\\n-\t'git tag -a disable configured tag.forcesignannotated' \\\n+test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \\\n \t'get_tag_header forcesignannotated-annotate $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \ttest_config tag.forcesignannotated true &&\n@@ -1087,8 +1041,7 @@ test_expect_success GPG \\\n \ttest_must_fail git tag -v forcesignannotated-annotate\n '\n \n-test_expect_success GPG \\\n-\t'git tag --sign enable GPG sign' \\\n+test_expect_success GPG 'git tag --sign enable GPG sign' \\\n \t'get_tag_header forcesignannotated-disabled $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1098,8 +1051,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'git tag configured tag.gpgsign enables GPG sign' \\\n+test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \\\n \t'get_tag_header gpgsign-enabled $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1109,8 +1061,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'git tag --no-sign configured tag.gpgsign skip GPG sign' \\\n+test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \\\n \t'get_tag_header no-sign $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \ttest_config tag.gpgsign true &&\n@@ -1119,8 +1070,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'trying to create a signed tag with non-existing -F file should fail' '\n+test_expect_success GPG 'trying to create a signed tag with non-existing -F file should fail' '\n \t! test -f nonexistingfile &&\n \t! tag_exists nosigtag &&\n \ttest_must_fail git tag -s -F nonexistingfile nosigtag &&\n@@ -1133,8 +1083,7 @@ test_expect_success GPG 'verifying a signed tag should succeed' \\\n test_expect_success GPG 'verifying two signed tags in one command should succeed' \\\n \t'git tag -v signed-tag file-signed-tag'\n \n-test_expect_success GPG \\\n-\t'verifying many signed and non-signed tags should fail' '\n+test_expect_success GPG 'verifying many signed and non-signed tags should fail' '\n \ttest_must_fail git tag -v signed-tag annotated-tag &&\n \ttest_must_fail git tag -v file-annotated-tag file-signed-tag &&\n \ttest_must_fail git tag -v annotated-tag \\\n@@ -1165,8 +1114,7 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent\n \n # blank and empty messages for signed tags:\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with an empty -m message should succeed' '\n+test_expect_success GPG 'creating a signed tag with an empty -m message should succeed' '\n \tget_tag_header empty-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"\" empty-signed-tag &&\n@@ -1175,8 +1123,7 @@ test_expect_success GPG \\\n \tgit tag -v empty-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with an empty -F messagefile should succeed' '\n+test_expect_success GPG 'creating a signed tag with an empty -F messagefile should succeed' '\n \t>sigemptyfile &&\n \tget_tag_header emptyfile-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1186,8 +1133,7 @@ test_expect_success GPG \\\n \tgit tag -v emptyfile-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'extra blanks in the message for a signed tag should be removed' '\n+test_expect_success GPG 'extra blanks in the message for a signed tag should be removed' '\n \tprintf \"\\n\\n  \\n\\t\\nLeading blank lines\\n\" >sigblanksfile &&\n \tprintf \"\\n\\t \\t  \\nRepeated blank lines\\n\" >>sigblanksfile &&\n \tprintf \"\\n\\n\\nTrailing spaces      \\t  \\n\" >>sigblanksfile &&\n@@ -1209,8 +1155,7 @@ test_expect_success GPG \\\n \tgit tag -v blanks-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with a blank -m message should succeed' '\n+test_expect_success GPG 'creating a signed tag with a blank -m message should succeed' '\n \tget_tag_header blank-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"     \" blank-signed-tag &&\n@@ -1219,8 +1164,7 @@ test_expect_success GPG \\\n \tgit tag -v blank-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with blank -F file with spaces should succeed' '\n+test_expect_success GPG 'creating a signed tag with blank -F file with spaces should succeed' '\n \techo \"     \" >sigblankfile &&\n \techo \"\"      >>sigblankfile &&\n \techo \"  \"    >>sigblankfile &&\n@@ -1232,8 +1176,7 @@ test_expect_success GPG \\\n \tgit tag -v blankfile-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with spaces and no newline should succeed' '\n+test_expect_success GPG 'creating a signed tag with spaces and no newline should succeed' '\n \tprintf \"      \" >sigblanknonlfile &&\n \tget_tag_header blanknonlfile-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1256,8 +1199,7 @@ test_expect_success GPG 'signed tag with embedded PGP message' '\n \n # messages with commented lines for signed tags:\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with a -F file with #comments should succeed' '\n+test_expect_success GPG 'creating a signed tag with a -F file with #comments should succeed' '\n \tcat >sigcommentsfile <<-\\EOF &&\n \t# A comment\n \n@@ -1291,8 +1233,7 @@ test_expect_success GPG \\\n \tgit tag -v comments-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with #commented -m message should succeed' '\n+test_expect_success GPG 'creating a signed tag with #commented -m message should succeed' '\n \tget_tag_header comment-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \tgit tag -s -m \"#comment\" comment-signed-tag &&\n@@ -1301,8 +1242,7 @@ test_expect_success GPG \\\n \tgit tag -v comment-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with #commented -F messagefile should succeed' '\n+test_expect_success GPG 'creating a signed tag with #commented -F messagefile should succeed' '\n \techo \"#comment\" >sigcommentfile &&\n \techo \"\"         >>sigcommentfile &&\n \techo \"####\"     >>sigcommentfile &&\n@@ -1314,8 +1254,7 @@ test_expect_success GPG \\\n \tgit tag -v commentfile-signed-tag\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag with a #comment and no newline should succeed' '\n+test_expect_success GPG 'creating a signed tag with a #comment and no newline should succeed' '\n \tprintf \"#comment\" >sigcommentnonlfile &&\n \tget_tag_header commentnonlfile-signed-tag $commit commit $time >expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n@@ -1327,8 +1266,7 @@ test_expect_success GPG \\\n \n # listing messages for signed tags:\n \n-test_expect_success GPG \\\n-\t'listing the one-line message of a signed tag should succeed' '\n+test_expect_success GPG 'listing the one-line message of a signed tag should succeed' '\n \tgit tag -s -m \"A message line signed\" stag-one-line &&\n \n \techo \"stag-one-line\" >expect &&\n@@ -1352,8 +1290,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'listing the zero-lines message of a signed tag should succeed' '\n+test_expect_success GPG 'listing the zero-lines message of a signed tag should succeed' '\n \tgit tag -s -m \"\" stag-zero-lines &&\n \n \techo \"stag-zero-lines\" >expect &&\n@@ -1377,8 +1314,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'listing many message lines of a signed tag should succeed' '\n+test_expect_success GPG 'listing many message lines of a signed tag should succeed' '\n \techo \"stag line one\" >sigtagmsg &&\n \techo \"stag line two\" >>sigtagmsg &&\n \techo \"stag line three\" >>sigtagmsg &&\n@@ -1423,8 +1359,7 @@ test_expect_success GPG \\\n \n # tags pointing to objects different from commits:\n \n-test_expect_success GPG \\\n-\t'creating a signed tag pointing to a tree should succeed' '\n+test_expect_success GPG 'creating a signed tag pointing to a tree should succeed' '\n \ttree=$(git rev-parse HEAD^{tree}) &&\n \tget_tag_header tree-signed-tag $tree tree $time >expect &&\n \techo \"A message for a tree\" >>expect &&\n@@ -1434,8 +1369,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag pointing to a blob should succeed' '\n+test_expect_success GPG 'creating a signed tag pointing to a blob should succeed' '\n \tblob=$(git rev-parse HEAD:foo) &&\n \tget_tag_header blob-signed-tag $blob blob $time >expect &&\n \techo \"A message for a blob\" >>expect &&\n@@ -1445,8 +1379,7 @@ test_expect_success GPG \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG \\\n-\t'creating a signed tag pointing to another tag should succeed' '\n+test_expect_success GPG 'creating a signed tag pointing to another tag should succeed' '\n \ttag=$(git rev-parse signed-tag 2>/dev/null) &&\n \tget_tag_header tag-signed-tag $tag tag $time >expect &&\n \techo \"A message for another tag\" >>expect &&\n@@ -1458,8 +1391,7 @@ test_expect_success GPG \\\n \n # usage with rfc1991 signatures\n \n-test_expect_success GPG,RFC1991 \\\n-\t'creating a signed tag with rfc1991' '\n+test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' '\n \tget_tag_header rfc1991-signed-tag $commit commit $time >expect &&\n \techo \"RFC1991 signed tag\" >>expect &&\n \techo \"-----BEGIN PGP MESSAGE-----\" >>expect &&\n@@ -1469,8 +1401,7 @@ test_expect_success GPG,RFC1991 \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'reediting a signed tag body omits signature' '\n+test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '\n \tcat >fakeeditor <<-\\EOF &&\n \t#!/bin/sh\n \tcp \"$1\" actual\n@@ -1482,14 +1413,12 @@ test_expect_success GPG,RFC1991 \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'verifying rfc1991 signature' '\n+test_expect_success GPG,RFC1991 'verifying rfc1991 signature' '\n \techo \"rfc1991\" >gpghome/gpg.conf &&\n \tgit tag -v rfc1991-signed-tag\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'list tag with rfc1991 signature' '\n+test_expect_success GPG,RFC1991 'list tag with rfc1991 signature' '\n \techo \"rfc1991\" >gpghome/gpg.conf &&\n \techo \"rfc1991-signed-tag RFC1991 signed tag\" >expect &&\n \tgit tag -l -n1 rfc1991-signed-tag >actual &&\n@@ -1500,14 +1429,12 @@ test_expect_success GPG,RFC1991 \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'verifying rfc1991 signature without --rfc1991' '\n+test_expect_success GPG,RFC1991 'verifying rfc1991 signature without --rfc1991' '\n \trm -f gpghome/gpg.conf &&\n \tgit tag -v rfc1991-signed-tag\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'list tag with rfc1991 signature without --rfc1991' '\n+test_expect_success GPG,RFC1991 'list tag with rfc1991 signature without --rfc1991' '\n \techo \"rfc1991-signed-tag RFC1991 signed tag\" >expect &&\n \tgit tag -l -n1 rfc1991-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1517,22 +1444,19 @@ test_expect_success GPG,RFC1991 \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG,RFC1991 \\\n-\t'reediting a signed tag body omits signature' '\n+test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '\n \techo \"RFC1991 signed tag\" >expect &&\n \tGIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&\n \ttest_cmp expect actual\n '\n \n # try to sign with bad user.signingkey\n-test_expect_success GPG \\\n-\t'git tag -s fails if gpg is misconfigured (bad key)' \\\n+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \\\n \t'test_config user.signingkey BobTheMouse &&\n \ttest_must_fail git tag -s -m tail tag-gpg-failure'\n \n # try to produce invalid signature\n-test_expect_success GPG \\\n-\t'git tag -s fails if gpg is misconfigured (bad signature format)' \\\n+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \\\n \t'test_config gpg.program echo &&\n \t test_must_fail git tag -s -m tail tag-gpg-failure'\n \n@@ -1555,34 +1479,29 @@ test_expect_success GPG 'git verifies tag is valid with double signature' '\n '\n \n # try to sign with bad user.signingkey\n-test_expect_success GPGSM \\\n-\t'git tag -s fails if gpgsm is misconfigured (bad key)' \\\n+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \\\n \t'test_config user.signingkey BobTheMouse &&\n \t test_config gpg.format x509 &&\n \t test_must_fail git tag -s -m tail tag-gpg-failure'\n \n # try to produce invalid signature\n-test_expect_success GPGSM \\\n-\t'git tag -s fails if gpgsm is misconfigured (bad signature format)' \\\n+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \\\n \t'test_config gpg.x509.program echo &&\n \t test_config gpg.format x509 &&\n \t test_must_fail git tag -s -m tail tag-gpg-failure'\n \n # try to verify without gpg:\n \n-test_expect_success GPG \\\n-\t'verify signed tag fails when public key is not present' \\\n+test_expect_success GPG 'verify signed tag fails when public key is not present' \\\n \t'rm -rf gpghome &&\n \ttest_must_fail git tag -v signed-tag\n '\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@@ -1593,15 +1512,13 @@ test_expect_success 'message in editor has initial comment: first line' '\n \ttest_cmp 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 '\n \n-test_expect_success \\\n-\t'overwriting an annotated tag should use its previous body' '\n+test_expect_success 'overwriting an annotated tag should use its previous body' '\n \tget_tag_header reuse $commit commit $time >expect &&\n \techo \"An annotation to be reused\" >>expect &&\n \tgit tag -a -m \"An annotation to be reused\" reuse &&\n-- \n2.43.0\n\n"},{"id":"500318","messageId":"20240807130259.28381-7-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 6/8] t7004: test description and test body seperated with backslash","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:42Z","receivedAt":"2024-08-07T13:03:35Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Test body should begin with a single quote right after the test\ndescription instead of backslash followed by new line.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 125 ++++++++++++++++++++++++++++---------------------\n 1 file changed, 71 insertions(+), 54 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 5cbb13a603..2b15ede1f3 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -61,8 +61,9 @@ test_expect_success 'sort tags, ignore case' '\n \t)\n '\n \n-test_expect_success 'looking for a tag in an empty tree should fail' \\\n-\t'! (tag_exists mytag)'\n+test_expect_success 'looking for a tag in an empty tree should fail' '\n+\t! (tag_exists mytag)\n+'\n \n test_expect_success 'creating a tag in an empty tree should fail' '\n \ttest_must_fail git tag mynotag &&\n@@ -148,25 +149,31 @@ test_expect_success 'listing all tags if one exists should output that tag' '\n \n # pattern matching:\n \n-test_expect_success 'listing a tag using a matching pattern should succeed' \\\n-\t'git tag -l mytag'\n+test_expect_success 'listing a tag using a matching pattern should succeed' '\n+\tgit tag -l mytag\n+'\n \n-test_expect_success 'listing a tag with --ignore-case' \\\n-\t'test $(git tag -l --ignore-case MYTAG) = mytag'\n+test_expect_success 'listing a tag with --ignore-case' '\n+\ttest $(git tag -l --ignore-case MYTAG) = mytag\n+'\n \n-test_expect_success '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 '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 '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 '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 'trying to create a tag with a non-valid name should fail' '\n \ttest $(git tag -l | wc -l) -eq 1 &&\n@@ -236,8 +243,9 @@ test_expect_success 'trying to delete two tags, existing and not, should fail in\n \t! tag_exists nonexistingtag\n '\n \n-test_expect_success 'trying to delete an already deleted tag should fail' \\\n-\t'test_must_fail git tag -d mytag'\n+test_expect_success 'trying to delete an already deleted tag should fail' '\n+\ttest_must_fail git tag -d mytag\n+'\n \n # listing various tags with pattern matching:\n \n@@ -417,14 +425,17 @@ test_expect_success 'a non-annotated tag created without parameters should point\n \ttest $(git rev-parse non-annotated-tag) = $(git rev-parse HEAD)\n '\n \n-test_expect_success 'trying to verify an unknown tag should fail' \\\n-\t'test_must_fail git tag -v unknown-tag'\n+test_expect_success 'trying to verify an unknown tag should fail' '\n+\ttest_must_fail git tag -v unknown-tag\n+'\n \n-test_expect_success '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 '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@@ -1014,8 +1025,8 @@ test_expect_success GPG '-s implies annotated tag' '\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' \\\n-\t'get_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&\n+test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' '\n+\tget_tag_header forcesignannotated-implied-sign $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \ttest_config tag.forcesignannotated true &&\n@@ -1024,15 +1035,15 @@ test_expect_success GPG 'git tag -s implied if configured with tag.forcesignanno\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' \\\n-\t'test_config tag.forcesignannotated true &&\n+test_expect_success GPG 'lightweight with no message when configured with tag.forcesignannotated' '\n+\ttest_config tag.forcesignannotated true &&\n \tgit tag forcesignannotated-lightweight &&\n \ttag_exists forcesignannotated-lightweight &&\n \ttest_must_fail git tag -v forcesignannotated-no-message\n '\n \n-test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \\\n-\t'get_tag_header forcesignannotated-annotate $commit commit $time >expect &&\n+test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' '\n+\tget_tag_header forcesignannotated-annotate $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \ttest_config tag.forcesignannotated true &&\n \tgit tag -a -m \"A message\" forcesignannotated-annotate &&\n@@ -1041,8 +1052,8 @@ test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' \\\n \ttest_must_fail git tag -v forcesignannotated-annotate\n '\n \n-test_expect_success GPG 'git tag --sign enable GPG sign' \\\n-\t'get_tag_header forcesignannotated-disabled $commit commit $time >expect &&\n+test_expect_success GPG 'git tag --sign enable GPG sign' '\n+\tget_tag_header forcesignannotated-disabled $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \ttest_config tag.forcesignannotated false &&\n@@ -1051,8 +1062,8 @@ test_expect_success GPG 'git tag --sign enable GPG sign' \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \\\n-\t'get_tag_header gpgsign-enabled $commit commit $time >expect &&\n+test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' '\n+\tget_tag_header gpgsign-enabled $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \techo \"-----BEGIN PGP SIGNATURE-----\" >>expect &&\n \ttest_config tag.gpgsign true &&\n@@ -1061,8 +1072,8 @@ test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' \\\n \ttest_cmp expect actual\n '\n \n-test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' \\\n-\t'get_tag_header no-sign $commit commit $time >expect &&\n+test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' '\n+\tget_tag_header no-sign $commit commit $time >expect &&\n \techo \"A message\" >>expect &&\n \ttest_config tag.gpgsign true &&\n \tgit tag -a --no-sign -m \"A message\" no-sign &&\n@@ -1077,11 +1088,13 @@ test_expect_success GPG 'trying to create a signed tag with non-existing -F file\n \t! tag_exists nosigtag\n '\n \n-test_expect_success GPG 'verifying a signed tag should succeed' \\\n-\t'git tag -v signed-tag'\n+test_expect_success GPG 'verifying a signed tag should succeed' '\n+\tgit tag -v signed-tag\n+'\n \n-test_expect_success GPG 'verifying two signed tags in one command should succeed' \\\n-\t'git tag -v signed-tag file-signed-tag'\n+test_expect_success GPG 'verifying two signed tags in one command should succeed' '\n+\tgit tag -v signed-tag file-signed-tag\n+'\n \n test_expect_success GPG 'verifying many signed and non-signed tags should fail' '\n \ttest_must_fail git tag -v signed-tag annotated-tag &&\n@@ -1451,14 +1464,16 @@ test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '\n '\n \n # try to sign with bad user.signingkey\n-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' \\\n-\t'test_config user.signingkey BobTheMouse &&\n-\ttest_must_fail git tag -s -m tail tag-gpg-failure'\n+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad key)' '\n+\ttest_config user.signingkey BobTheMouse &&\n+\ttest_must_fail git tag -s -m tail tag-gpg-failure\n+'\n \n # try to produce invalid signature\n-test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' \\\n-\t'test_config gpg.program echo &&\n-\t test_must_fail git tag -s -m tail tag-gpg-failure'\n+test_expect_success GPG 'git tag -s fails if gpg is misconfigured (bad signature format)' '\n+\ttest_config gpg.program echo &&\n+\ttest_must_fail git tag -s -m tail tag-gpg-failure\n+'\n \n # try to produce invalid signature\n test_expect_success GPG 'git verifies tag is valid with double signature' '\n@@ -1479,21 +1494,23 @@ test_expect_success GPG 'git verifies tag is valid with double signature' '\n '\n \n # try to sign with bad user.signingkey\n-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' \\\n-\t'test_config user.signingkey BobTheMouse &&\n-\t test_config gpg.format x509 &&\n-\t test_must_fail git tag -s -m tail tag-gpg-failure'\n+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad key)' '\n+\ttest_config user.signingkey BobTheMouse &&\n+\ttest_config gpg.format x509 &&\n+\ttest_must_fail git tag -s -m tail tag-gpg-failure\n+'\n \n # try to produce invalid signature\n-test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' \\\n-\t'test_config gpg.x509.program echo &&\n-\t test_config gpg.format x509 &&\n-\t test_must_fail git tag -s -m tail tag-gpg-failure'\n+test_expect_success GPGSM 'git tag -s fails if gpgsm is misconfigured (bad signature format)' '\n+\ttest_config gpg.x509.program echo &&\n+\ttest_config gpg.format x509 &&\n+\ttest_must_fail git tag -s -m tail tag-gpg-failure\n+'\n \n # try to verify without gpg:\n \n-test_expect_success GPG 'verify signed tag fails when public key is not present' \\\n-\t'rm -rf gpghome &&\n+test_expect_success GPG 'verify signed tag fails when public key is not present' '\n+\trm -rf gpghome &&\n \ttest_must_fail git tag -v signed-tag\n '\n \n-- \n2.43.0\n\n"},{"id":"500319","messageId":"20240807130259.28381-8-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 7/8] t7004: use single quotes instead of double quotes","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:43Z","receivedAt":"2024-08-07T13:03:36Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Some test bodies and test description are surrounded with double\nquotes instead of single quotes, violating our coding style.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 70 +++++++++++++++++++++++++-------------------------\n 1 file changed, 35 insertions(+), 35 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 2b15ede1f3..046a5bd9bc 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1583,7 +1583,7 @@ test_expect_success 'creating third commit without tag' '\n \n # simple linear checks of --continue\n \n-test_expect_success 'checking that first commit is in all tags (hash)' \"\n+test_expect_success 'checking that first commit is in all tags (hash)' '\n \thash3=$(git rev-parse HEAD) &&\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n@@ -1594,10 +1594,10 @@ test_expect_success 'checking that first commit is in all tags (hash)' \"\n \tEOF\n \tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n # other ways of specifying the commit\n-test_expect_success 'checking that first commit is in all tags (tag)' \"\n+test_expect_success 'checking that first commit is in all tags (tag)' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1607,9 +1607,9 @@ test_expect_success 'checking that first commit is in all tags (tag)' \"\n \tEOF\n \tgit tag -l --contains v1.0 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n-test_expect_success 'checking that first commit is in all tags (relative)' \"\n+test_expect_success 'checking that first commit is in all tags (relative)' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1619,33 +1619,33 @@ test_expect_success 'checking that first commit is in all tags (relative)' \"\n \tEOF\n \tgit tag -l --contains HEAD~2 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n # All the --contains tests above, but with --no-contains\n-test_expect_success 'checking that first commit is not listed in any tag with --no-contains  (hash)' \"\n+test_expect_success 'checking that first commit is not listed in any tag with --no-contains  (hash)' '\n \tgit tag -l --no-contains $hash1 v* >actual &&\n \ttest_must_be_empty actual\n-\"\n+'\n \n-test_expect_success 'checking that first commit is in all tags (tag)' \"\n+test_expect_success 'checking that first commit is in all tags (tag)' '\n \tgit tag -l --no-contains v1.0 v* >actual &&\n \ttest_must_be_empty actual\n-\"\n+'\n \n-test_expect_success 'checking that first commit is in all tags (relative)' \"\n+test_expect_success 'checking that first commit is in all tags (relative)' '\n \tgit tag -l --no-contains HEAD~2 v* >actual &&\n \ttest_must_be_empty actual\n-\"\n+'\n \n-test_expect_success 'checking that second commit only has one tag' \"\n+test_expect_success 'checking that second commit only has one tag' '\n \tcat >expected <<-\\EOF &&\n \tv2.0\n \tEOF\n \tgit tag -l --contains $hash2 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n-test_expect_success 'inverse of the last test, with --no-contains' \"\n+test_expect_success 'inverse of the last test, with --no-contains' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1654,14 +1654,14 @@ test_expect_success 'inverse of the last test, with --no-contains' \"\n \tEOF\n \tgit tag -l --no-contains $hash2 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n-test_expect_success 'checking that third commit has no tags' \"\n+test_expect_success 'checking that third commit has no tags' '\n \tgit tag -l --contains $hash3 v* >actual &&\n \ttest_must_be_empty actual\n-\"\n+'\n \n-test_expect_success 'conversely --no-contains on the third commit lists all tags' \"\n+test_expect_success 'conversely --no-contains on the third commit lists all tags' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1671,7 +1671,7 @@ test_expect_success 'conversely --no-contains on the third commit lists all tags\n \tEOF\n \tgit tag -l --no-contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n # how about a simple merge?\n \n@@ -1692,7 +1692,7 @@ test_expect_success 'checking that branch head only has one tag' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'checking that branch head with --no-contains lists all but one tag' \"\n+test_expect_success 'checking that branch head with --no-contains lists all but one tag' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1702,22 +1702,22 @@ test_expect_success 'checking that branch head with --no-contains lists all but\n \tEOF\n \tgit tag -l --no-contains $hash4 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n test_expect_success 'merging original branch into this branch' '\n \tgit merge --strategy=ours main &&\n         git tag v4.0\n '\n \n-test_expect_success 'checking that original branch head has one tag now' \"\n+test_expect_success 'checking that original branch head has one tag now' '\n \tcat >expected <<-\\EOF &&\n \tv4.0\n \tEOF\n \tgit tag -l --contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n-test_expect_success 'checking that original branch head with --no-contains lists all but one tag now' \"\n+test_expect_success 'checking that original branch head with --no-contains lists all but one tag now' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1728,9 +1728,9 @@ test_expect_success 'checking that original branch head with --no-contains lists\n \tEOF\n \tgit tag -l --no-contains $hash3 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n-test_expect_success 'checking that initial commit is in all tags' \"\n+test_expect_success 'checking that initial commit is in all tags' '\n \tcat >expected <<-\\EOF &&\n \tv0.2.1\n \tv1.0\n@@ -1742,7 +1742,7 @@ test_expect_success 'checking that initial commit is in all tags' \"\n \tEOF\n \tgit tag -l --contains $hash1 v* >actual &&\n \ttest_cmp expected actual\n-\"\n+'\n \n test_expect_success 'checking that --contains can be used in non-list mode' '\n \tcat >expected <<-\\EOF &&\n@@ -1758,10 +1758,10 @@ test_expect_success 'checking that --contains can be used in non-list mode' '\n \ttest_cmp expected actual\n '\n \n-test_expect_success 'checking that initial commit is in all tags with --no-contains' \"\n+test_expect_success 'checking that initial commit is in all tags with --no-contains' '\n \tgit tag -l --no-contains $hash1 v* >actual &&\n \ttest_must_be_empty actual\n-\"\n+'\n \n # mixing modes and options:\n \n@@ -1798,16 +1798,16 @@ test_expect_success 'mixing incompatibles modes and options is forbidden' '\n \n for option in --contains --with --no-contains --without --merged --no-merged --points-at\n do\n-\ttest_expect_success \"mixing incompatible modes with $option is forbidden\" \"\n+\ttest_expect_success \"mixing incompatible modes with $option is forbidden\" '\n \t\ttest_must_fail git tag -d $option HEAD &&\n \t\ttest_must_fail git tag -d $option HEAD some-tag &&\n \t\ttest_must_fail git tag -v $option HEAD\n-\t\"\n-\ttest_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" \"\n+\t'\n+\ttest_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" '\n \t\tgit tag -n $option HEAD HEAD &&\n \t\tgit tag $option HEAD HEAD &&\n \t\tgit tag $option\n-\t\"\n+\t'\n done\n \n # check points-at\n@@ -2183,7 +2183,7 @@ test_expect_success 'git tag -l with --format=\"%(rest)\" must fail' '\n \ttest_must_fail git tag -l --format=\"%(rest)\" \"v1*\"\n '\n \n-test_expect_success \"set up color tests\" '\n+test_expect_success 'set up color tests' '\n \techo \"<RED>v1.0<RESET>\" >expect.color &&\n \techo \"v1.0\" >expect.bare &&\n \tcolor_args=\"--format=%(color:red)%(refname:short) --list v1.0\"\n-- \n2.43.0\n\n"},{"id":"500320","messageId":"20240807130259.28381-9-abdobngad@gmail.com","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"[PATCH v5 8/8] t7004: make use of write_script","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-07T12:58:44Z","receivedAt":"2024-08-07T13:03:37Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Use write_script which takes care of emitting the `#!/bin/sh` line\nand the `chmod +x`.\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 8 ++------\n 1 file changed, 2 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex 046a5bd9bc..b1316e62f4 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -974,13 +974,11 @@ test_expect_success GPG 'sign with an unknown id (2)' '\n '\n \n test_expect_success GPG '-u implies signed tag' '\n-\tcat >fakeeditor <<-\\EOF &&\n-\t#!/bin/sh\n+\twrite_script fakeeditor <<-\\EOF &&\n \ttest -n \"$1\" && exec >\"$1\"\n \techo A signed tag message\n \techo from a fake editor.\n \tEOF\n-\tchmod +x fakeeditor &&\n \n \tget_tag_header implied-sign $commit commit $time >expect &&\n \t./fakeeditor >>expect &&\n@@ -1415,11 +1413,9 @@ test_expect_success GPG,RFC1991 'creating a signed tag with rfc1991' '\n '\n \n test_expect_success GPG,RFC1991 'reediting a signed tag body omits signature' '\n-\tcat >fakeeditor <<-\\EOF &&\n-\t#!/bin/sh\n+\twrite_script fakeeditor <<-\\EOF &&\n \tcp \"$1\" actual\n \tEOF\n-\tchmod +x fakeeditor &&\n \techo \"rfc1991\" >gpghome/gpg.conf &&\n \techo \"RFC1991 signed tag\" >expect &&\n \tGIT_EDITOR=./fakeeditor git tag -f -s rfc1991-signed-tag $commit &&\n-- \n2.43.0\n\n"},{"id":"500478","messageId":"xmqqed6zkowv.fsf@gitster.g","threadId":"61915","inReplyTo":"20240807130259.28381-8-abdobngad@gmail.com","subject":"Re: [PATCH v5 7/8] t7004: use single quotes instead of double quotes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-08T15:36:00Z","receivedAt":"2024-08-08T15:36:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"AbdAlRahman Gad <abdobngad@gmail.com> writes:\n\n> Some test bodies and test description are surrounded with double\n> quotes instead of single quotes, violating our coding style.\n>\n> Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n> ---\n>  t/t7004-tag.sh | 70 +++++++++++++++++++++++++-------------------------\n>  1 file changed, 35 insertions(+), 35 deletions(-)\n\nThe conversion in this step can cause unintended breakage and needs\nto be carefully done, so I checked with \"git show -W\" (I probably\nshould have done -U999 instead of just -W).\n\n> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n> index 2b15ede1f3..046a5bd9bc 100755\n> --- a/t/t7004-tag.sh\n> +++ b/t/t7004-tag.sh\n> @@ -1583,7 +1583,7 @@ test_expect_success 'creating third commit without tag' '\n>  \n>  # simple linear checks of --continue\n>  \n> -test_expect_success 'checking that first commit is in all tags (hash)' \"\n> +test_expect_success 'checking that first commit is in all tags (hash)' '\n>  \thash3=$(git rev-parse HEAD) &&\n\nThe original used to resolve \"HEAD\" while formulating the command\nline of test_expect_success.  Now we resolve \"HEAD\" as the first\nthing the body given to test_expect_success is run.  As HEAD does\nnot move between these two points in time, hash3 would get the same\nvalue either way.\n\n\n>  \tcat >expected <<-\\EOF &&\n>  \tv0.2.1\n> @@ -1594,10 +1594,10 @@ test_expect_success 'checking that first commit is in all tags (hash)' \"\n>  \tEOF\n>  \tgit tag -l --contains $hash1 v* >actual &&\n>  \ttest_cmp expected actual\n> -\"\n> +'\n\nThe argument to the \"--contains\" option was interpolated while the\ncommand line of test_expect_success was formulated.  If the body of\nthis test_expect_success modified the value of $hash1, this conversion\nwould have changed what the tested command did, but because nobody\nassigns to $hash1 after it gets assigned (and this is true for other\n$hash[0-9] variables), this conversion is OK.\n\n>  for option in --contains --with --no-contains --without --merged --no-merged --points-at\n>  do\n> -\ttest_expect_success \"mixing incompatible modes with $option is forbidden\" \"\n> +\ttest_expect_success \"mixing incompatible modes with $option is forbidden\" '\n>  \t\ttest_must_fail git tag -d $option HEAD &&\n>  \t\ttest_must_fail git tag -d $option HEAD some-tag &&\n>  \t\ttest_must_fail git tag -v $option HEAD\n> -\t\"\n> -\ttest_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" \"\n> +\t'\n> +\ttest_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" '\n>  \t\tgit tag -n $option HEAD HEAD &&\n>  \t\tgit tag $option HEAD HEAD &&\n>  \t\tgit tag $option\n> -\t\"\n> +\t'\n\nLikewise.\n\nThe value of $option of course changes for each iteration of the\nloop, and the original interpolated it into the tested scripts while\ntest_expect_success command lines were formulated in the original.\nNow the variable $option is used just like any other variable while\nthe body is run, and the tested scripts behave identically either\nway.\n\nLooks good.  Thanks.\n"},{"id":"500480","messageId":"xmqq5xsbkolo.fsf@gitster.g","threadId":"61915","inReplyTo":"20240807130259.28381-1-abdobngad@gmail.com","subject":"Re: [PATCH v5 0/8] [Newcomer] t7004: modernize the style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-08T15:42:43Z","receivedAt":"2024-08-08T15:42:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"AbdAlRahman Gad <abdobngad@gmail.com> writes:\n\n> - Remove whitespace after the redirect operators.\n>\n> - Move number of expect files prepared outside of\n>   test_expect_success to be inside the tests that use it.\n>\n> - Split some lines that have two commands into two lines\n>   one command each.\n>\n> - Turn some \"<<\\EOF\" into \"<<-\\EOF\" and indent their body.\n>\n> - Avoid using pipes in the output from \"test-tool ref-store\"\n>   and write the output to a file.\n>\n> - Change test_expect_success that are seperated from its name\n>   to be on the same line.\n>\n> - Avoid separating test Description and test body with backslash\n>\n> - Use single quotes instead of double quotes for test description and\n>   body.\n>\n> - Use write_script which takes care of emitting the `#!/bin/sh` line\n>   and the `chmod +x`.\n\nI gave another look and they all looked fine.  Except the title of\none step that said\n\n    t7004: test Description and test body seperated with backslash\n\nwas a \"Huh?  what does it even mean?\".\n\n    t7004: begin the test body on the same line as test_expect_success\n\nor something?  I dunno.\n\n> There are still tests that could lose exit status to pipe. This needs\n> to be modernized too, I will fix them in another patch series.\n\n;-)\n\nAnother one that I noticed is that we have quite a lot of\n\n\tcat >expect <<-EOF &&\n\tv1.1.3\n\tv2.0\n\tv3.0\n\tEOF\n\nthat can be shortend to\n\n\ttest_write_lines >expect v1.1.3 v2.0 v3.0 &&\n\nTo use without extra quoting, test_write_lines is more limited, but\nthe majority of here-doc used for expect files in this test are\nenumeration of tag names that we can write without any extra frills,\nand test_write_lines may be a very good fit for these use cases.\n\nThanks.\n\n\n"},{"id":"500487","messageId":"485c3474-992f-41f3-aaaf-0ad1d43464c4@gmail.com","threadId":"61915","inReplyTo":"xmqq5xsbkolo.fsf@gitster.g","subject":"Re: [PATCH v5 0/8] [Newcomer] t7004: modernize the style","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-08T16:18:43Z","receivedAt":"2024-08-08T16:18:49Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/8/24 18:42, Junio C Hamano wrote:\n> AbdAlRahman Gad <abdobngad@gmail.com> writes:\n> \n>> - Remove whitespace after the redirect operators.\n>>\n>> - Move number of expect files prepared outside of\n>>    test_expect_success to be inside the tests that use it.\n>>\n>> - Split some lines that have two commands into two lines\n>>    one command each.\n>>\n>> - Turn some \"<<\\EOF\" into \"<<-\\EOF\" and indent their body.\n>>\n>> - Avoid using pipes in the output from \"test-tool ref-store\"\n>>    and write the output to a file.\n>>\n>> - Change test_expect_success that are seperated from its name\n>>    to be on the same line.\n>>\n>> - Avoid separating test Description and test body with backslash\n>>\n>> - Use single quotes instead of double quotes for test description and\n>>    body.\n>>\n>> - Use write_script which takes care of emitting the `#!/bin/sh` line\n>>    and the `chmod +x`.\n> \n> I gave another look and they all looked fine.  Except the title of\n> one step that said\n> \n>      t7004: test Description and test body seperated with backslash\n> \n> was a \"Huh?  what does it even mean?\".\n> \n>      t7004: begin the test body on the same line as test_expect_success\n> \n> or something?  I dunno.\n> \n\nThanks! I'll send a v6 right away.\n\n>> There are still tests that could lose exit status to pipe. This needs\n>> to be modernized too, I will fix them in another patch series.\n> \n> ;-)\n> \n> Another one that I noticed is that we have quite a lot of\n> \n> \tcat >expect <<-EOF &&\n> \tv1.1.3\n> \tv2.0\n> \tv3.0\n> \tEOF\n> \n> that can be shortend to\n> \n> \ttest_write_lines >expect v1.1.3 v2.0 v3.0 &&\n> \n> To use without extra quoting, test_write_lines is more limited, but\n> the majority of here-doc used for expect files in this test are\n> enumeration of tag names that we can write without any extra frills,\n> and test_write_lines may be a very good fit for these use cases.\n> \n> Thanks.\n\nI'll work on them the next patch series.\n\n\n"}]}