{"thread":{"id":"61907","subject":"[PATCH v4 0/8] t7004: Modernize the style","startedAt":"2024-08-05T23:59:45Z","lastAt":"2024-08-06T18:05:14Z","messageCount":21,"participants":["AbdAlRahman Gad","Junio C Hamano","Eric Sunshine"],"isPatch":true,"patchVersion":4,"patchTotal":8},"messages":[{"id":"500128","messageId":"20240805235917.190699-1-abdobngad@gmail.com","threadId":"61907","inReplyTo":null,"subject":"[PATCH v4 0/8] t7004: Modernize the style","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:09Z","receivedAt":"2024-08-05T23:59:45Z","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\nAbdAlRahman Gad (8):\n  [Newcomer] t7004: Remove space after redirect operators\n  [Newcomer] t7004: Do not lose exit status to pipe\n  [Newcomer] t7004: One command per line\n  [Newcomer] t7004: Do not prepare things outside test_expect_success\n  [Newcomer] t7004: Use indented here-doc\n  [Newcomer] t7004: Description on the same line as test_expect_success\n  [Newcomer] t7004: Description and test body seperated with backslash\n  [Newcomer] t7004: Use single quotes instead of double quotes\n\n t/t7004-tag.sh | 1154 +++++++++++++++++++++++-------------------------\n 1 file changed, 557 insertions(+), 597 deletions(-)\n\n\nbase-commit: 406f326d271e0bacecdb00425422c5fa3f314930\n-- \n2.43.0\n\n"},{"id":"500129","messageId":"20240805235917.190699-2-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 1/8] [Newcomer] t7004: Remove space after redirect operators","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:10Z","receivedAt":"2024-08-05T23:59:45Z","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":"500130","messageId":"20240805235917.190699-3-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 2/8] [Newcomer] t7004: Do not lose exit status to pipe","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:11Z","receivedAt":"2024-08-05T23:59:46Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Split \"test-tool ... | sed\" pipeline into two commands to avoid losing\nexit status from test-tool.\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..1e31f39646 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -97,7 +97,8 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '\n \ttest_when_finished \"git tag -d tag_with_reflog1\" &&\n \tgit tag --create-reflog tag_with_reflog1 &&\n \tgit reflog exists refs/tags/tag_with_reflog1 &&\n-\ttest-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e \"s/^.*\t//\" >actual &&\n+\ttest-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body &&\n+\tsed -e \"s/^.*\t//\" actual.body >actual &&\n \ttest_cmp expected actual\n '\n \n@@ -108,7 +109,8 @@ test_expect_success 'annotated tag with --create-reflog has correct message' '\n \ttest_when_finished \"git tag -d tag_with_reflog2\" &&\n \tgit tag -m \"annotated tag\" --create-reflog tag_with_reflog2 &&\n \tgit reflog exists refs/tags/tag_with_reflog2 &&\n-\ttest-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 | sed -e \"s/^.*\t//\" >actual &&\n+\ttest-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog2 >actual.body &&\n+\tsed -e \"s/^.*\t//\" actual.body >actual &&\n \ttest_cmp expected actual\n '\n \n-- \n2.43.0\n\n"},{"id":"500131","messageId":"20240805235917.190699-4-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 3/8] [Newcomer] t7004: One command per line","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:12Z","receivedAt":"2024-08-05T23:59:48Z","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 1e31f39646..cfe7653317 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -215,9 +215,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":"500132","messageId":"20240805235917.190699-5-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 4/8] [Newcomer] t7004: Do not prepare things outside test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:13Z","receivedAt":"2024-08-05T23:59:51Z","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.\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 cfe7653317..b9fe58fbee 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -131,10 +131,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@@ -209,12 +209,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@@ -252,18 +252,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@@ -279,62 +279,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@@ -345,19 +345,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@@ -371,6 +377,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@@ -453,68 +465,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@@ -543,67 +556,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+  echo \"\"      >>blankfile &&\n+  echo \"  \"    >>blankfile &&\n+  get_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+  get_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@@ -611,62 +624,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@@ -848,11 +861,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+  echo \"tag line two\" >>annotagmsg &&\n+  echo \"tag line three\" >>annotagmsg  &&\n \tgit tag -F annotagmsg tag-lines &&\n \n \techo \"tag-lines\" >expect &&\n@@ -960,20 +973,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@@ -993,65 +1006,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@@ -1065,44 +1078,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@@ -1154,78 +1167,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@@ -1245,69 +1258,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@@ -1366,11 +1379,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@@ -1412,60 +1425,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@@ -1490,10 +1502,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@@ -1561,10 +1572,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@@ -1590,10 +1602,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@@ -1622,47 +1634,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@@ -1683,23 +1705,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@@ -1709,15 +1729,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@@ -1732,26 +1751,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@@ -1761,45 +1777,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":"500133","messageId":"20240805235917.190699-6-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 5/8] [Newcomer] t7004: Use indented here-doc","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:14Z","receivedAt":"2024-08-05T23:59:52Z","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 b9fe58fbee..242e38887b 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -389,10 +389,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@@ -400,10 +400,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@@ -414,17 +414,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":"500134","messageId":"20240805235917.190699-7-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 6/8] [Newcomer] t7004: Description on the same line as test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:15Z","receivedAt":"2024-08-05T23:59:54Z","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 242e38887b..6c93192d5d 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -156,26 +156,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@@ -209,8 +204,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@@ -222,8 +216,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@@ -231,15 +224,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@@ -279,8 +270,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@@ -291,8 +281,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@@ -301,8 +290,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@@ -311,8 +299,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@@ -320,8 +307,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@@ -329,8 +315,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@@ -339,14 +324,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@@ -430,8 +413,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@@ -440,12 +422,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@@ -465,8 +445,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@@ -483,8 +462,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@@ -492,8 +470,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@@ -512,8 +489,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@@ -533,16 +509,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@@ -556,16 +530,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@@ -573,8 +545,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@@ -594,16 +565,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   echo \"\"      >>blankfile &&\n   echo \"  \"    >>blankfile &&\n@@ -613,8 +582,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   get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect &&\n \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n@@ -624,8 +592,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@@ -657,16 +624,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@@ -676,8 +641,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@@ -796,8 +760,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@@ -836,8 +799,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@@ -861,8 +823,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   echo \"tag line two\" >>annotagmsg &&\n   echo \"tag line three\" >>annotagmsg  &&\n@@ -953,20 +914,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@@ -1023,8 +981,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@@ -1059,8 +1016,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@@ -1070,16 +1026,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@@ -1089,8 +1043,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@@ -1100,8 +1053,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@@ -1111,8 +1063,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@@ -1121,8 +1072,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@@ -1135,8 +1085,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@@ -1167,8 +1116,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@@ -1177,8 +1125,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@@ -1188,8 +1135,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@@ -1211,8 +1157,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@@ -1221,8 +1166,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@@ -1234,8 +1178,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@@ -1258,8 +1201,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@@ -1293,8 +1235,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@@ -1303,8 +1244,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@@ -1316,8 +1256,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@@ -1329,8 +1268,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@@ -1354,8 +1292,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@@ -1379,8 +1316,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@@ -1425,8 +1361,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@@ -1436,8 +1371,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@@ -1447,8 +1381,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@@ -1460,8 +1393,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@@ -1471,8 +1403,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@@ -1484,14 +1415,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@@ -1502,14 +1431,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@@ -1519,22 +1446,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@@ -1557,34 +1481,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@@ -1595,15 +1514,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":"500135","messageId":"20240805235917.190699-8-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 7/8] [Newcomer] t7004: test Description and test body seperated with backslash","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:16Z","receivedAt":"2024-08-05T23:59:55Z","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 6c93192d5d..a46f8141d4 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@@ -150,25 +151,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@@ -238,8 +245,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@@ -419,14 +427,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@@ -1016,8 +1027,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@@ -1026,15 +1037,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@@ -1043,8 +1054,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@@ -1053,8 +1064,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@@ -1063,8 +1074,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@@ -1079,11 +1090,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@@ -1453,14 +1466,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@@ -1481,21 +1496,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":"500136","messageId":"20240805235917.190699-9-abdobngad@gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"[PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-05T23:59:17Z","receivedAt":"2024-08-05T23:59:57Z","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 a46f8141d4..06f07b5524 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -1585,7 +1585,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@@ -1596,10 +1596,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@@ -1609,9 +1609,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@@ -1621,33 +1621,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@@ -1656,14 +1656,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@@ -1673,7 +1673,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@@ -1694,7 +1694,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@@ -1704,22 +1704,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@@ -1730,9 +1730,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@@ -1744,7 +1744,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@@ -1760,10 +1760,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@@ -1800,16 +1800,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@@ -2185,7 +2185,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":"500143","messageId":"xmqqzfpqzdgk.fsf@gitster.g","threadId":"61907","inReplyTo":"20240805235917.190699-1-abdobngad@gmail.com","subject":"Re: [PATCH v4 0/8] t7004: Modernize the style","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-06T00:45:15Z","receivedAt":"2024-08-06T00:45:17Z","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> AbdAlRahman Gad (8):\n>   [Newcomer] t7004: Remove space after redirect operators\n>   [Newcomer] t7004: Do not lose exit status to pipe\n>   [Newcomer] t7004: One command per line\n>   [Newcomer] t7004: Do not prepare things outside test_expect_success\n>   [Newcomer] t7004: Use indented here-doc\n>   [Newcomer] t7004: Description on the same line as test_expect_success\n>   [Newcomer] t7004: Description and test body seperated with backslash\n>   [Newcomer] t7004: Use single quotes instead of double quotes\n\nAs you can see from \"git shortlog --no-merges --since=6.months\", we\ndo not capitalize the first word of the title description of each\npatch.\n\nAlso, I haven't looked at the individual patches, it seems the patch\nis somewhoat whitespace damaged.\n\n    $ git am -s ./+ag8-v4\n    Applying: t7004: remove space after redirect operators\n    .git/rebase-apply/patch:169: indent with spaces.\n            git checkout stable &&\n    .git/rebase-apply/patch:193: indent with spaces.\n            git tag v4.0\n    warning: 2 lines add whitespace errors.\n    Applying: t7004: do not lose exit status to pipe\n    Applying: t7004: one command per line\n    Applying: t7004: do not prepare things outside test_expect_success\n    .git/rebase-apply/patch:1188: indent with spaces.\n            git tag v4.0\n    warning: 1 line adds whitespace errors.\n    Applying: t7004: use indented here-doc\n    Applying: t7004: description on the same line as test_expect_success\n    Applying: t7004: test description and test body seperated with backslash\n    Applying: t7004: use single quotes instead of double quotes\n    .git/rebase-apply/patch:133: indent with spaces.\n            git tag v4.0\n    warning: 1 line adds whitespace errors.\n\n"},{"id":"500147","messageId":"CAPig+cSzq+6bua=T7w0M-+7+2zbzfD6ihXLkWfondZ8NbqUG4A@mail.gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-9-abdobngad@gmail.com","subject":"Re: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T03:02:01Z","receivedAt":"2024-08-06T03:02:13Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\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> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n> @@ -1585,7 +1585,7 @@ test_expect_success 'creating third commit without tag' '\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>         hash3=$(git rev-parse HEAD) &&\n>         ...\n>         git tag -l --contains $hash1 v* >actual &&\n>         test_cmp expected actual\n> -\"\n> +'\n\nWe need to exercise a bit of caution when making this sort of change\nbecause a \"...\" string differs from a '...' string in shell. For\ninstance, in a \"...\" string, interpolation occurs as the string is\nscanned by the shell, whereas a '...' string is taken as a literal.\nThus, in the above, when it was using a double-quoted string,\nexpressions such as `$(git rev-parse HEAD)` and `$hash1` were being\nevaluated and interpolated into the string _before_ the\ntest_expect_success() function is even called. On the other hand, with\na single-quoted string, those expression do not get evaluated when the\nstring is scanned, thus remain as-is when passed to\ntest_expect_success() as an argument, and they are evaluated only\nlater when test_expect_success() invokes `eval` on that argument.\nDepending upon the situation, this difference in evaluation context\nmay have a significant impact.\n\nAs a practical example, consider a test with a body like this:\n\n    echo nothing >nothing &&\n    git add nothing &&\n    git commit -m nothing &&\n    hash=$(git rev-parse HEAD) &&\n    ...\n\nIf this body is inside a double-quoted string, then `$(git rev-parse\nHEAD)` will be evaluated and its value assigned to `hash` _before_\ntest_expect_success() is called, thus also before the `git commit`\ncommand inside the test body (which is almost certainly not what the\nauthor intended). On the other hand, inside a single-quoted string,\n`$(git rev-parse HEAD)` will be evaluated only once\ntest_expect_success() runs the test body, meaning `$(git rev-parse\nHEAD)` will correctly be evaluated _after_ `git commit`. Hence, `hash`\nwill have a different value depending upon whether single- or\ndouble-quotes are used.\n\nHaving said all that, in this case, you seem to have lucked out and\nnothing broke by changing the double-quotes to single-quotes around\nthe test bodies.\n\nHowever...\n\n> @@ -1800,16 +1800,16 @@ test_expect_success 'mixing incompatibles modes and options is forbidden' '\n>  for option in --contains --with --no-contains --without --merged --no-merged --points-at\n>  do\n> -       test_expect_success \"mixing incompatible modes with $option is forbidden\" \"\n> +       test_expect_success 'mixing incompatible modes with $option is forbidden' '\n>                 test_must_fail git tag -d $option HEAD &&\n>                 test_must_fail git tag -d $option HEAD some-tag &&\n>                 test_must_fail git tag -v $option HEAD\n> -       \"\n> -       test_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" \"\n> +       '\n> +       test_expect_success 'Doing \"git tag --list-like $option <commit> <pattern> is permitted' '\n>                 git tag -n $option HEAD HEAD &&\n>                 git tag $option HEAD HEAD &&\n>                 git tag $option\n> -       \"\n> +       '\n>  done\n\n... changing the double-quotes to single-quotes for the test _titles_\nin these instances is actively wrong. In this case, we _want_\ninterpolation of `$option` to happen in the title string so that the\noutput looks like this:\n\n    ok 167 - mixing incompatible modes with --contains is forbidden\n    ok 169 - mixing incompatible modes with --with is forbidden\n    ok 171 - mixing incompatible modes with --no-contains is forbidden\n\nBy changing the title to use single-quotes, you suppress interpolation\nof `$option`, with the result that the displayed titles become rather\nuseless:\n\n    ok 167 - mixing incompatible modes with $option is forbidden\n    ok 169 - mixing incompatible modes with $option is forbidden\n    ok 171 - mixing incompatible modes with $option is forbidden\n"},{"id":"500148","messageId":"CAPig+cS6-gqZbJSz3wBcummyycJVudKybVZW=D33WHk-Fa9ytQ@mail.gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-3-abdobngad@gmail.com","subject":"Re: [PATCH v4 2/8] [Newcomer] t7004: Do not lose exit status to pipe","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T03:13:37Z","receivedAt":"2024-08-06T03:13:49Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> Split \"test-tool ... | sed\" pipeline into two commands to avoid losing\n> exit status from test-tool.\n>\n> Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n> ---\n> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n> @@ -97,7 +97,8 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '\n> -       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e \"s/^.* //\" >actual &&\n> +       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body &&\n> +       sed -e \"s/^.*   //\" actual.body >actual &&\n\nIt's not just `test_tool` we care about; we also (importantly) don't\nwant to see `git` itself upstream of a pipe, and there are many such\ninstances remaining in this script. Here are some common examples:\n\n    test $(git tag -l | wc -l) -eq 0 &&\n    git cat-file tag \"$1\" | sed -e \"/BEGIN PGP/q\"\n    git tag -l | grep \"^tag-one-line\" >actual &&\n    forged=$(git cat-file tag ... | sed -e ... | git mktag) &&\n    git tag -l --no-sort \"foo*\" | sort >actual &&\n\nBy the way, these days, rather than:\n\n    test $(git tag -l | wc -l) -eq 0 &&\n\nwe would say:\n\n    test_stdout_line_count = 0 git tag -l &&\n\nwhich nicely avoids placing `git` upstream of a pipe.\n"},{"id":"500149","messageId":"CAPig+cQehwONpjnjPVJEVvviistiSLODLNx-yFBusEPaihnf+w@mail.gmail.com","threadId":"61907","inReplyTo":"20240805235917.190699-5-abdobngad@gmail.com","subject":"Re: [PATCH v4 4/8] [Newcomer] t7004: Do not prepare things outside test_expect_success","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T03:29:05Z","receivedAt":"2024-08-06T03:29:17Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> Do not prepare expect and other things outside test_expect_success.\n> Also add '\\' before EOF to avoid shell interpolation and '-' to allow\n> indentation of the body.\n>\n> Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n\nWhen you reroll, it might be a good idea to explain _why_ we don't\nwant to run code outside of `test_expect_success`: in particular, if\nsuch code fails for some reason, we won't necessarily hear about it in\na 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\n>  test_expect_success GPG,RFC1991 \\\n>         'reediting a signed tag body omits signature' '\n> +       cat >fakeeditor <<-\\EOF &&\n> +       #!/bin/sh\n> +       cp \"$1\" actual\n> +       EOF\n> +       chmod +x fakeeditor &&\n\nIt's completely outside the scope of this particular patch, but\nanother modernization which could be done in a separate patch (or a\nseparate patch series -- it doesn't need to be part of this series)\nwould be to take advantage of `write_script` which eliminates some of\nthe boilerplate-work that the above code is doing. For instance:\n\n    write_script fakeeditor <<-\\EOF\n    cp \"$1\" actual\n    EOF\n\nNotice that `write_script` takes care of emitting the `#!/bin/sh` line\nand the `chmod +x`.\n"},{"id":"500165","messageId":"3cba795c-631b-4e86-a1f2-ddefe76ef0f4@gmail.com","threadId":"61907","inReplyTo":"CAPig+cS6-gqZbJSz3wBcummyycJVudKybVZW=D33WHk-Fa9ytQ@mail.gmail.com","subject":"Re: [PATCH v4 2/8] [Newcomer] t7004: Do not lose exit status to pipe","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-06T08:38:33Z","receivedAt":"2024-08-06T08:38:38Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/6/24 06:13, Eric Sunshine wrote:\n> On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n>> Split \"test-tool ... | sed\" pipeline into two commands to avoid losing\n>> exit status from test-tool.\n>>\n>> Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n>> ---\n>> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n>> @@ -97,7 +97,8 @@ test_expect_success 'creating a tag with --create-reflog should create reflog' '\n>> -       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e \"s/^.* //\" >actual &&\n>> +       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body &&\n>> +       sed -e \"s/^.*   //\" actual.body >actual &&\n> \n> It's not just `test_tool` we care about; we also (importantly) don't\n> want to see `git` itself upstream of a pipe, and there are many such\n> instances remaining in this script. Here are some common examples:\n> \n>      test $(git tag -l | wc -l) -eq 0 &&\n>      git cat-file tag \"$1\" | sed -e \"/BEGIN PGP/q\"\n>      git tag -l | grep \"^tag-one-line\" >actual &&\n>      forged=$(git cat-file tag ... | sed -e ... | git mktag) &&\n>      git tag -l --no-sort \"foo*\" | sort >actual &&\n> \n> By the way, these days, rather than:\n> \n>      test $(git tag -l | wc -l) -eq 0 &&\n> \n> we would say:\n> \n>      test_stdout_line_count = 0 git tag -l &&\n> \n> which nicely avoids placing `git` upstream of a pipe.\n\nThanks for the review. Could this be done in a separate patch series? As \nmodifying a patch in the beginning of a patch series requires lots of \ntime to adapt the rest of the series to the change.\n"},{"id":"500166","messageId":"fa477ba6-18d2-461f-86fb-4fff75464b9c@gmail.com","threadId":"61907","inReplyTo":"CAPig+cQehwONpjnjPVJEVvviistiSLODLNx-yFBusEPaihnf+w@mail.gmail.com","subject":"Re: [PATCH v4 4/8] [Newcomer] t7004: Do not prepare things outside test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-06T08:41:29Z","receivedAt":"2024-08-06T08:41:32Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/6/24 06:29, Eric Sunshine wrote:\n> On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n>> Do not prepare expect and other things outside test_expect_success.\n>> Also add '\\' before EOF to avoid shell interpolation and '-' to allow\n>> indentation of the body.\n>>\n>> Signed-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n> \n> When you reroll, it might be a good idea to explain _why_ we don't\n> want to run code outside of `test_expect_success`: in particular, if\n> such code fails for some reason, we won't necessarily hear about it in\n> 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\nThanks! I'll do that in the next version.\n\n>>   test_expect_success GPG,RFC1991 \\\n>>          'reediting a signed tag body omits signature' '\n>> +       cat >fakeeditor <<-\\EOF &&\n>> +       #!/bin/sh\n>> +       cp \"$1\" actual\n>> +       EOF\n>> +       chmod +x fakeeditor &&\n> \n> It's completely outside the scope of this particular patch, but\n> another modernization which could be done in a separate patch (or a\n> separate patch series -- it doesn't need to be part of this series)\n> would be to take advantage of `write_script` which eliminates some of\n> the boilerplate-work that the above code is doing. For instance:\n> \n>      write_script fakeeditor <<-\\EOF\n>      cp \"$1\" actual\n>      EOF\n> \n> Notice that `write_script` takes care of emitting the `#!/bin/sh` line\n> and the `chmod +x`.\n\nThere is only two cases in this file. I'll add a patch to the end of v5.\n"},{"id":"500167","messageId":"749fcee3-5bb1-49ff-b476-6bb75f4b92f8@gmail.com","threadId":"61907","inReplyTo":"xmqqzfpqzdgk.fsf@gitster.g","subject":"Re: [PATCH v4 0/8] t7004: Modernize the style","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-06T08:44:04Z","receivedAt":"2024-08-06T08:44:08Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/6/24 03:45, Junio C Hamano wrote:\n> AbdAlRahman Gad <abdobngad@gmail.com> writes:\n> \n>> AbdAlRahman Gad (8):\n>>    [Newcomer] t7004: Remove space after redirect operators\n>>    [Newcomer] t7004: Do not lose exit status to pipe\n>>    [Newcomer] t7004: One command per line\n>>    [Newcomer] t7004: Do not prepare things outside test_expect_success\n>>    [Newcomer] t7004: Use indented here-doc\n>>    [Newcomer] t7004: Description on the same line as test_expect_success\n>>    [Newcomer] t7004: Description and test body seperated with backslash\n>>    [Newcomer] t7004: Use single quotes instead of double quotes\n> \n> As you can see from \"git shortlog --no-merges --since=6.months\", we\n> do not capitalize the first word of the title description of each\n> patch.\n> \n> Also, I haven't looked at the individual patches, it seems the patch\n> is somewhoat whitespace damaged.\n> \n>      $ git am -s ./+ag8-v4\n>      Applying: t7004: remove space after redirect operators\n>      .git/rebase-apply/patch:169: indent with spaces.\n>              git checkout stable &&\n>      .git/rebase-apply/patch:193: indent with spaces.\n>              git tag v4.0\n>      warning: 2 lines add whitespace errors.\n>      Applying: t7004: do not lose exit status to pipe\n>      Applying: t7004: one command per line\n>      Applying: t7004: do not prepare things outside test_expect_success\n>      .git/rebase-apply/patch:1188: indent with spaces.\n>              git tag v4.0\n>      warning: 1 line adds whitespace errors.\n>      Applying: t7004: use indented here-doc\n>      Applying: t7004: description on the same line as test_expect_success\n>      Applying: t7004: test description and test body seperated with backslash\n>      Applying: t7004: use single quotes instead of double quotes\n>      .git/rebase-apply/patch:133: indent with spaces.\n>              git tag v4.0\n>      warning: 1 line adds whitespace errors.\n> \n\nThanks! I'll fix that and send a v5.\n"},{"id":"500192","messageId":"207c4f3c-c444-4405-bed7-34186efa1144@gmail.com","threadId":"61907","inReplyTo":"CAPig+cSzq+6bua=T7w0M-+7+2zbzfD6ihXLkWfondZ8NbqUG4A@mail.gmail.com","subject":"Re: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-06T10:10:32Z","receivedAt":"2024-08-06T10:18:38Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/6/24 06:02, Eric Sunshine wrote:\n> On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\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>> diff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\n>> @@ -1585,7 +1585,7 @@ test_expect_success 'creating third commit without tag' '\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>>          hash3=$(git rev-parse HEAD) &&\n>>          ...\n>>          git tag -l --contains $hash1 v* >actual &&\n>>          test_cmp expected actual\n>> -\"\n>> +'\n> \n> We need to exercise a bit of caution when making this sort of change\n> because a \"...\" string differs from a '...' string in shell. For\n> instance, in a \"...\" string, interpolation occurs as the string is\n> scanned by the shell, whereas a '...' string is taken as a literal.\n> Thus, in the above, when it was using a double-quoted string,\n> expressions such as `$(git rev-parse HEAD)` and `$hash1` were being\n> evaluated and interpolated into the string _before_ the\n> test_expect_success() function is even called. On the other hand, with\n> a single-quoted string, those expression do not get evaluated when the\n> string is scanned, thus remain as-is when passed to\n> test_expect_success() as an argument, and they are evaluated only\n> later when test_expect_success() invokes `eval` on that argument.\n> Depending upon the situation, this difference in evaluation context\n> may have a significant impact.\n> \n> As a practical example, consider a test with a body like this:\n> \n>      echo nothing >nothing &&\n>      git add nothing &&\n>      git commit -m nothing &&\n>      hash=$(git rev-parse HEAD) &&\n>      ...\n> \n> If this body is inside a double-quoted string, then `$(git rev-parse\n> HEAD)` will be evaluated and its value assigned to `hash` _before_\n> test_expect_success() is called, thus also before the `git commit`\n> command inside the test body (which is almost certainly not what the\n> author intended). On the other hand, inside a single-quoted string,\n> `$(git rev-parse HEAD)` will be evaluated only once\n> test_expect_success() runs the test body, meaning `$(git rev-parse\n> HEAD)` will correctly be evaluated _after_ `git commit`. Hence, `hash`\n> will have a different value depending upon whether single- or\n> double-quotes are used.\n> \n> Having said all that, in this case, you seem to have lucked out and\n> nothing broke by changing the double-quotes to single-quotes around\n> the test bodies.\n> \n> However...\n> \n>> @@ -1800,16 +1800,16 @@ test_expect_success 'mixing incompatibles modes and options is forbidden' '\n>>   for option in --contains --with --no-contains --without --merged --no-merged --points-at\n>>   do\n>> -       test_expect_success \"mixing incompatible modes with $option is forbidden\" \"\n>> +       test_expect_success 'mixing incompatible modes with $option is forbidden' '\n>>                  test_must_fail git tag -d $option HEAD &&\n>>                  test_must_fail git tag -d $option HEAD some-tag &&\n>>                  test_must_fail git tag -v $option HEAD\n>> -       \"\n>> -       test_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" \"\n>> +       '\n>> +       test_expect_success 'Doing \"git tag --list-like $option <commit> <pattern> is permitted' '\n>>                  git tag -n $option HEAD HEAD &&\n>>                  git tag $option HEAD HEAD &&\n>>                  git tag $option\n>> -       \"\n>> +       '\n>>   done\n> \n> ... changing the double-quotes to single-quotes for the test _titles_\n> in these instances is actively wrong. In this case, we _want_\n> interpolation of `$option` to happen in the title string so that the\n> output looks like this:\n> \n>      ok 167 - mixing incompatible modes with --contains is forbidden\n>      ok 169 - mixing incompatible modes with --with is forbidden\n>      ok 171 - mixing incompatible modes with --no-contains is forbidden\n> \n> By changing the title to use single-quotes, you suppress interpolation\n> of `$option`, with the result that the displayed titles become rather\n> useless:\n> \n>      ok 167 - mixing incompatible modes with $option is forbidden\n>      ok 169 - mixing incompatible modes with $option is forbidden\n>      ok 171 - mixing incompatible modes with $option is forbidden\n\nThanks for the through explanation! Should I not include this patch in \nv5 as the test body is error-prune or should I revert changing the \ndouble-quotes to single-quotes for test description and keep the changes \nto the test body and send the patch with v5?\n\n\n\n"},{"id":"500233","messageId":"xmqqo765vcbu.fsf@gitster.g","threadId":"61907","inReplyTo":"CAPig+cSzq+6bua=T7w0M-+7+2zbzfD6ihXLkWfondZ8NbqUG4A@mail.gmail.com","subject":"Re: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-06T16:35:33Z","receivedAt":"2024-08-06T16:35:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Sunshine <sunshine@sunshineco.com> writes:\n\n> As a practical example, consider a test with a body like this:\n>\n>     echo nothing >nothing &&\n>     git add nothing &&\n>     git commit -m nothing &&\n>     hash=$(git rev-parse HEAD) &&\n>     ...\n>\n> If this body is inside a double-quoted string, then `$(git rev-parse\n> HEAD)` will be evaluated and its value assigned to `hash` _before_\n> test_expect_success() is called,\n\nI know it is just your finger slipping, but the variable \"hash\" is\nnot assigned to before test_expect_success is called even with the\nbody inside dq.  \n\nWhat happens is that the value of HEAD is expanded in the string\nthat will be evaled by test_expect_success so the 4th line in the\nabove becomes \"hash=3469a23659d8197190d2765cf9f31dec5ab602fa &&\";\nas the resulting string is then eval'ed by test_expect_success,\nthe end result is as you descirbed, i.e., ...\n\n> thus also before the `git commit`\n> command inside the test body (which is almost certainly not what the\n> author intended).\n\n... $hash does not get the name of the commit object resulting from\nthe \"git commit\" command before it.\n\n>> -       \"\n>> -       test_expect_success \"Doing 'git tag --list-like $option <commit> <pattern> is permitted\" \"\n>> +       '\n>> +       test_expect_success 'Doing \"git tag --list-like $option <commit> <pattern> is permitted' '\n>\n> ... changing the double-quotes to single-quotes for the test _titles_\n> in these instances is actively wrong. In this case, we _want_\n> interpolation of `$option` to happen in the title string so that the\n> output looks like this:\n>\n>     ok 167 - mixing incompatible modes with --contains is forbidden\n>     ok 169 - mixing incompatible modes with --with is forbidden\n>     ok 171 - mixing incompatible modes with --no-contains is forbidden\n>\n> By changing the title to use single-quotes, you suppress interpolation\n> of `$option`, with the result that the displayed titles become rather\n> useless:\n>\n>     ok 167 - mixing incompatible modes with $option is forbidden\n>     ok 169 - mixing incompatible modes with $option is forbidden\n>     ok 171 - mixing incompatible modes with $option is forbidden\n\nYes, these has to be done carefully, both for titles and bodies.\n\nThanks.\n"},{"id":"500239","messageId":"CAPig+cSrwb42EphyaDbV_bt=GjxTfq4rYzGf7DA86Z1=2Nqycw@mail.gmail.com","threadId":"61907","inReplyTo":"xmqqo765vcbu.fsf@gitster.g","subject":"Re: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T17:11:17Z","receivedAt":"2024-08-06T17:11:29Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Aug 6, 2024 at 12:35 PM Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Sunshine <sunshine@sunshineco.com> writes:\n> > As a practical example, consider a test with a body like this:\n> >\n> >     echo nothing >nothing &&\n> >     git add nothing &&\n> >     git commit -m nothing &&\n> >     hash=$(git rev-parse HEAD) &&\n> >     ...\n> >\n> > If this body is inside a double-quoted string, then `$(git rev-parse\n> > HEAD)` will be evaluated and its value assigned to `hash` _before_\n> > test_expect_success() is called,\n>\n> I know it is just your finger slipping, but the variable \"hash\" is\n> not assigned to before test_expect_success is called even with the\n> body inside dq.\n\nUgh, you're quite correct, of course. The \"and its value assigned to\n`hash`\" part was one of those last-moment-edits which come back to\nhaunt the author. That's not so much a finger slip as an outright\nbungle. Thanks for catching and correcting this.\n\n> What happens is that the value of HEAD is expanded in the string\n> that will be evaled by test_expect_success so the 4th line in the\n> above becomes \"hash=3469a23659d8197190d2765cf9f31dec5ab602fa &&\";\n> as the resulting string is then eval'ed by test_expect_success,\n> the end result is as you descirbed, i.e., ...\n> ... $hash does not get the name of the commit object resulting from\n> the \"git commit\" command before it.\n\nIncluding an actual example of the resulting string, as you did here,\ndoes a much better job of illustrating the issue than my bungled\nlast-moment-edit.\n"},{"id":"500240","messageId":"CAPig+cQPXh-wmNYGSEX_3-C3ydF-O7k22tAx8hB_N55ZYo-aDQ@mail.gmail.com","threadId":"61907","inReplyTo":"207c4f3c-c444-4405-bed7-34186efa1144@gmail.com","subject":"Re: [PATCH v4 8/8] [Newcomer] t7004: Use single quotes instead of double quotes","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T17:21:37Z","receivedAt":"2024-08-06T17:21:49Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Aug 6, 2024 at 6:10 AM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> On 8/6/24 06:02, Eric Sunshine wrote:\n> > We need to exercise a bit of caution when making this sort of change\n> > because a \"...\" string differs from a '...' string in shell. [...]\n> > [...]\n> > Having said all that, in this case, you seem to have lucked out and\n> > nothing broke by changing the double-quotes to single-quotes around\n> > the test bodies.\n> >\n> > However...\n> > ... changing the double-quotes to single-quotes for the test _titles_\n> > in these instances is actively wrong. In this case, we _want_\n> > interpolation of `$option` to happen in the title string so that the\n> > output looks like this:\n> >      ok 167 - mixing incompatible modes with --contains is forbidden\n> >\n> > By changing the title to use single-quotes, you suppress interpolation\n> > of `$option`, with the result that the displayed titles become rather\n> > useless:\n> >      ok 167 - mixing incompatible modes with $option is forbidden\n>\n> Thanks for the through explanation! Should I not include this patch in\n> v5 as the test body is error-prune or should I revert changing the\n> double-quotes to single-quotes for test description and keep the changes\n> to the test body and send the patch with v5?\n\nOverall, the changes made by this patch are valuable since it brings\nthe script more in line with modern practice and because single-quotes\naround the test body make it easier for readers to reason about test\nbehavior. Coupled with the fact that none of the tests broke by\nchanging the bodies from double- to single-quote, it's a good idea to\nkeep this patch in v5 but omit the parts which break the test\ndescriptions.\n"},{"id":"500243","messageId":"CAPig+cRQSVZrOrHUaQCG91PbWpgUEbpFVAM5sriRgTSrkCnMvg@mail.gmail.com","threadId":"61907","inReplyTo":"3cba795c-631b-4e86-a1f2-ddefe76ef0f4@gmail.com","subject":"Re: [PATCH v4 2/8] [Newcomer] t7004: Do not lose exit status to pipe","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-06T18:05:01Z","receivedAt":"2024-08-06T18:05:14Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Aug 6, 2024 at 4:38 AM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> On 8/6/24 06:13, Eric Sunshine wrote:\n> > On Mon, Aug 5, 2024 at 8:00 PM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> >> -       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 | sed -e \"s/^.* //\" >actual &&\n> >> +       test-tool ref-store main for-each-reflog-ent refs/tags/tag_with_reflog1 >actual.body &&\n> >> +       sed -e \"s/^.*   //\" actual.body >actual &&\n> >\n> > It's not just `test_tool` we care about; we also (importantly) don't\n> > want to see `git` itself upstream of a pipe, and there are many such\n> > instances remaining in this script. Here are some common examples:\n> >\n> >      test $(git tag -l | wc -l) -eq 0 &&\n> >      git cat-file tag \"$1\" | sed -e \"/BEGIN PGP/q\"\n> >      git tag -l | grep \"^tag-one-line\" >actual &&\n> >      forged=$(git cat-file tag ... | sed -e ... | git mktag) &&\n> >      git tag -l --no-sort \"foo*\" | sort >actual &&\n>\n> Thanks for the review. Could this be done in a separate patch series? As\n> modifying a patch in the beginning of a patch series requires lots of\n> time to adapt the rest of the series to the change.\n\nAs the person doing the work and submitting the patches, you choose\nhow much effort to put in. If you feel that fixing all the \"`git`\nupstream of a pipe\" problems is better left for a future\n\"modernization\" series, then that's almost certainly fine. Since\nreviewers are trying to help you polish your patches, they usually\nprefer to review shorter series than longer ones anyhow. If you decide\nnot to make these changes, though, be sure to explain your decision in\nthe cover letter so that reviewers understand why such a cleanup is\nmissing from the current series.\n\nHaving said that, if you're not going to fix all the \"`git` upstream\nof a pipe\" cases, then you might consider dropping this patch from the\ncurrent series since it is merely touching the \"tip of the iceberg\" by\nfixing only these two minor cases while leaving all the more\nsignificant cases unfixed. But other reviewers may feel differently.\n\nIf you're worried about the ripple effect of making significant\nchanges to this patch which sits near the beginning of the series,\nthen one way to sidestep the issue is to relocate this patch to the\nend of the series. This is possible because, unlike many other patch\nseries in which there is inherent order in the patches where each\nchange must follow the preceding change, that is not the case with\nthis patch series. The specific order of patches in this series is\npretty much immaterial. So, moving this patch to the end of the series\nwould cause only a tiny ripple since it touches only two small chunks\nof code, and once the patch is last in the series, then it becomes\neasy to apply all the other \"`git` upstream of a pipe\" fixes.\n\nBut it's up to you if you want to do that extra work. As noted above,\nreviewers usually prefer a shorter simpler series over a longer more\ncomplex one, so relegating such fixes to a followup series is almost\ncertainly acceptable. (But be sure to explain your decision in the\ncover letter.)\n"}]}