{"thread":{"id":"61898","subject":"[PATCH v3 0/6] [Newcomer] t7004: modernize the style","startedAt":"2024-08-04T07:12:24Z","lastAt":"2024-08-05T09:42:10Z","messageCount":15,"participants":["AbdAlRahman Gad","Eric Sunshine","Junio C Hamano","Patrick Steinhardt"],"isPatch":true,"patchVersion":3,"patchTotal":6},"messages":[{"id":"500010","messageId":"20240804071137.30326-1-abdobngad@gmail.com","threadId":"61898","inReplyTo":null,"subject":"[PATCH v3 0/6] [Newcomer] t7004: modernize the style","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:31Z","receivedAt":"2024-08-04T07:12:24Z","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\nAbdAlRahman Gad (6):\n  [Newcomer] t7004-tag: redirection operator\n  [Newcomer] t7004-tag: do not lose exit status to pipe\n  [Newcomer] t7004-tag: one command per line\n  [Newcomer] t7004-tag: do not prepare except outside\n    test_expect_success\n  [Newcomer] t7004-tag: here-doc modernization\n  [Newcomer] t7004-tag: description on the same line as\n    test_expect_success\n\n t/t7004-tag.sh | 584 +++++++++++++++++++++++--------------------------\n 1 file changed, 274 insertions(+), 310 deletions(-)\n\n\nbase-commit: 406f326d271e0bacecdb00425422c5fa3f314930\n-- \n2.43.0\n\n"},{"id":"500011","messageId":"20240804071137.30326-2-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 1/6] [Newcomer] t7004-tag: redirection operator","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:32Z","receivedAt":"2024-08-04T07:12:25Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"Modernaize 't7004-tag.sh' by removing whitespace\nafter the 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":"500012","messageId":"20240804071137.30326-3-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 2/6] [Newcomer] t7004-tag: do not lose exit status to pipe","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:33Z","receivedAt":"2024-08-04T07:12:26Z","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\nto avoid losing exit 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":"500013","messageId":"20240804071137.30326-4-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 3/6] [Newcomer] t7004-tag: one command per line","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:34Z","receivedAt":"2024-08-04T07:12:27Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"fix lines like these:\n\ngit tag -l >actual && test_cmp expect actual &&\n\nto\n\ngit tag -l >actual &&\ntest_cmp expect actual &&\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":"500014","messageId":"20240804071137.30326-5-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 4/6] [Newcomer] t7004-tag: do not prepare except outside test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:35Z","receivedAt":"2024-08-04T07:12:27Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"do not prepare expect outside test_expect_success\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 224 +++++++++++++++++++++++++++----------------------\n 1 file changed, 123 insertions(+), 101 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex cfe7653317..96aa908eaf 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@@ -1683,23 +1695,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 +1719,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@@ -1734,24 +1743,22 @@ test_expect_success 'creating simple branch' '\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+\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 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,50 +1768,65 @@ 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 \n test_expect_success 'checking that initial commit is in all tags with --no-contains' \"\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 --no-contains $hash1 v* >actual &&\n \ttest_must_be_empty actual\n \"\n-- \n2.43.0\n\n"},{"id":"500015","messageId":"20240804071137.30326-6-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 5/6] [Newcomer] t7004-tag: here-doc modernization","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:36Z","receivedAt":"2024-08-04T07:12:28Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"use <<-\\EOF to indent 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 96aa908eaf..c60167d6fd 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":"500016","messageId":"20240804071137.30326-7-abdobngad@gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-1-abdobngad@gmail.com","subject":"[PATCH v3 6/6] [Newcomer] t7004-tag: description on the same line as test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T07:11:37Z","receivedAt":"2024-08-04T07:12:30Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"changed test_expect_success that are seperated from its name like:\n\n   test_expect_success \\\n   \t'trying to delete tags without params ....' '\n\n   test_expect_success GPG \\\n\t'trying to verify an annotated ....' '\n\nto\n\n   test_expect_success 'trying to delete tags without params ....' '\n\n   test_expect_success GPG 'trying to verify an annotated.... ' '\n\nSigned-off-by: AbdAlRahman Gad <abdobngad@gmail.com>\n---\n t/t7004-tag.sh | 280 +++++++++++++++++++------------------------------\n 1 file changed, 109 insertions(+), 171 deletions(-)\n\ndiff --git a/t/t7004-tag.sh b/t/t7004-tag.sh\nindex c60167d6fd..c7674c9241 100755\n--- a/t/t7004-tag.sh\n+++ b/t/t7004-tag.sh\n@@ -156,26 +156,25 @@ test_expect_success 'listing a tag using a matching pattern should succeed' \\\n test_expect_success 'listing a tag with --ignore-case' \\\n \t'test $(git tag -l --ignore-case MYTAG) = mytag'\n \n-test_expect_success \\\n-\t'listing a tag using a matching pattern should output that tag' \\\n-\t'test $(git tag -l mytag) = mytag'\n+test_expect_success 'listing a tag using a matching pattern should output that tag' '\n+\ttest $(git tag -l mytag) = mytag\n+'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should succeed' \\\n-\t'git tag -l xxx'\n+test_expect_success 'listing tags using a non-matching pattern should succeed' '\n+\tgit tag -l xxx\n+'\n \n-test_expect_success \\\n-\t'listing tags using a non-matching pattern should output nothing' \\\n-\t'test $(git tag -l xxx | wc -l) -eq 0'\n+test_expect_success 'listing tags using a non-matching pattern should output nothing' '\n+\ttest $(git tag -l xxx | wc -l) -eq 0\n+'\n \n # special cases for creating tags:\n \n-test_expect_success \\\n-\t'trying to create a tag with the name of one existing should fail' \\\n-\t'test_must_fail git tag mytag'\n+test_expect_success 'trying to create a tag with the name of one existing should fail' '\n+\ttest_must_fail git tag mytag\n+'\n \n-test_expect_success \\\n-\t'trying to create a tag with a non-valid name should fail' '\n+test_expect_success 'trying to create a tag with a non-valid name should fail' '\n \ttest $(git tag -l | wc -l) -eq 1 &&\n \ttest_must_fail git tag \"\" &&\n \ttest_must_fail git tag .othertag &&\n@@ -209,8 +208,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 +220,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 +228,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 +274,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 +285,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 +294,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 +303,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 +311,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 +319,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 +328,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,23 +417,23 @@ 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 '\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 \\\n-\t'trying to verify a non-annotated and non-signed tag should fail' \\\n-\t'test_must_fail git tag -v non-annotated-tag'\n+test_expect_success 'trying to verify a non-annotated and non-signed tag should fail' '\n+\ttest_must_fail git tag -v non-annotated-tag\n+'\n \n-test_expect_success \\\n-\t'trying to verify many non-annotated or unknown tags, should fail' \\\n-\t'test_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2'\n+test_expect_success 'trying to verify many non-annotated or unknown tags, should fail' '\n+\ttest_must_fail git tag -v unknown-tag1 non-annotated-tag unknown-tag2\n+'\n \n # creating annotated tags:\n \n@@ -470,8 +457,7 @@ time=$test_tick\n \n get_tag_header annotated-tag $commit commit $time >expect\n echo \"A message\" >>expect\n-test_expect_success \\\n-\t'creating an annotated tag with -m message should succeed' '\n+test_expect_success 'creating an annotated tag with -m message should succeed' '\n \tgit tag -m \"A message\" annotated-tag &&\n \tget_tag_msg annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -485,8 +471,7 @@ test_expect_success 'set up editor' '\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n-test_expect_success \\\n-\t'creating an annotated tag with -m message --edit should succeed' '\n+test_expect_success 'creating an annotated tag with -m message --edit should succeed' '\n \tGIT_EDITOR=./fakeeditor git tag -m \"A message\" --edit annotated-tag-edit &&\n \tget_tag_msg annotated-tag-edit >actual &&\n \ttest_cmp expect actual\n@@ -498,8 +483,7 @@ in a file.\n EOF\n get_tag_header file-annotated-tag $commit commit $time >expect\n cat msgfile >>expect\n-test_expect_success \\\n-\t'creating an annotated tag with -F messagefile should succeed' '\n+test_expect_success 'creating an annotated tag with -F messagefile should succeed' '\n \tgit tag -F msgfile file-annotated-tag &&\n \tget_tag_msg file-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -513,8 +497,7 @@ test_expect_success 'set up editor' '\n \tmv \"$1-\" \"$1\"\n \tEOF\n '\n-test_expect_success \\\n-\t'creating an annotated tag with -F messagefile --edit should succeed' '\n+test_expect_success 'creating an annotated tag with -F messagefile --edit should succeed' '\n \tGIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit &&\n \tget_tag_msg file-annotated-tag-edit >actual &&\n \ttest_cmp expect actual\n@@ -532,16 +515,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,8 +537,7 @@ test_expect_success \\\n # blank and empty messages:\n \n get_tag_header empty-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with an empty -m message should succeed' '\n+test_expect_success 'creating a tag with an empty -m message should succeed' '\n \tgit tag -m \"\" empty-annotated-tag &&\n \tget_tag_msg empty-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -565,8 +545,7 @@ test_expect_success \\\n \n >emptyfile\n get_tag_header emptyfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with an empty -F messagefile should succeed' '\n+test_expect_success 'creating a tag with an empty -F messagefile should succeed' '\n \tgit tag -F emptyfile emptyfile-annotated-tag &&\n \tget_tag_msg emptyfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -586,16 +565,14 @@ Trailing spaces\n \n Trailing blank lines\n EOF\n-test_expect_success \\\n-\t'extra blanks in the message for an annotated tag should be removed' '\n+test_expect_success 'extra blanks in the message for an annotated tag should be removed' '\n \tgit tag -F blanksfile blanks-annotated-tag &&\n \tget_tag_msg blanks-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n get_tag_header blank-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with blank -m message with spaces should succeed' '\n+test_expect_success 'creating a tag with blank -m message with spaces should succeed' '\n \tgit tag -m \"     \" blank-annotated-tag &&\n \tget_tag_msg blank-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -605,8 +582,7 @@ echo '     ' >blankfile\n echo ''      >>blankfile\n echo '  '    >>blankfile\n get_tag_header blankfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with blank -F messagefile with spaces should succeed' '\n+test_expect_success 'creating a tag with blank -F messagefile with spaces should succeed' '\n \tgit tag -F blankfile blankfile-annotated-tag &&\n \tget_tag_msg blankfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -614,8 +590,7 @@ test_expect_success \\\n \n printf '      ' >blanknonlfile\n get_tag_header blanknonlfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with -F file of spaces and no newline should succeed' '\n+test_expect_success 'creating a tag with -F file of spaces and no newline should succeed' '\n \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n \tget_tag_msg blanknonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -649,16 +624,14 @@ Another line.\n \n Last line.\n EOF\n-test_expect_success \\\n-\t'creating a tag using a -F messagefile with #comments should succeed' '\n+test_expect_success 'creating a tag using a -F messagefile with #comments should succeed' '\n \tgit tag -F commentsfile comments-annotated-tag &&\n \tget_tag_msg comments-annotated-tag >actual &&\n \ttest_cmp expect actual\n '\n \n get_tag_header comment-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with a #comment in the -m message should succeed' '\n+test_expect_success 'creating a tag with a #comment in the -m message should succeed' '\n \tgit tag -m \"#comment\" comment-annotated-tag &&\n \tget_tag_msg comment-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -668,8 +641,7 @@ echo '#comment' >commentfile\n echo ''         >>commentfile\n echo '####'     >>commentfile\n get_tag_header commentfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with #comments in the -F messagefile should succeed' '\n+test_expect_success 'creating a tag with #comments in the -F messagefile should succeed' '\n \tgit tag -F commentfile commentfile-annotated-tag &&\n \tget_tag_msg commentfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -677,8 +649,7 @@ test_expect_success \\\n \n printf '#comment' >commentnonlfile\n get_tag_header commentnonlfile-annotated-tag $commit commit $time >expect\n-test_expect_success \\\n-\t'creating a tag with a file of #comment and no newline should succeed' '\n+test_expect_success 'creating a tag with a file of #comment and no newline should succeed' '\n \tgit tag -F commentnonlfile commentnonlfile-annotated-tag &&\n \tget_tag_msg commentnonlfile-annotated-tag >actual &&\n \ttest_cmp expect actual\n@@ -795,8 +766,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@@ -835,8 +805,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@@ -863,8 +832,7 @@ test_expect_success \\\n echo 'tag line one' >annotagmsg\n echo 'tag line two' >>annotagmsg\n echo 'tag line three' >>annotagmsg\n-test_expect_success \\\n-\t'listing many message lines of a non-signed tag should succeed' '\n+test_expect_success 'listing many message lines of a non-signed tag should succeed' '\n \tgit tag -F annotagmsg tag-lines &&\n \n \techo \"tag-lines\" >expect &&\n@@ -952,20 +920,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@@ -1029,8 +994,7 @@ 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+test_expect_success GPG 'creating a signed tag with -F messagefile should succeed' '\n \tgit tag -s -F sigmsgfile file-signed-tag &&\n \tget_tag_msg file-signed-tag >actual &&\n \ttest_cmp expect actual\n@@ -1061,17 +1025,15 @@ test_expect_success GPG '-s implies annotated tag' '\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+test_expect_success GPG 'git tag -s implied if configured with tag.forcesignannotated' '\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 '\n \n-test_expect_success GPG \\\n-\t'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@@ -1079,9 +1041,8 @@ test_expect_success GPG \\\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+test_expect_success GPG 'git tag -a disable configured tag.forcesignannotated' '\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@@ -1091,9 +1052,8 @@ test_expect_success GPG \\\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+test_expect_success GPG 'git tag --sign enable GPG sign' '\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@@ -1102,9 +1062,8 @@ test_expect_success GPG \\\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+test_expect_success GPG 'git tag configured tag.gpgsign enables GPG sign' '\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@@ -1112,30 +1071,29 @@ test_expect_success GPG \\\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+test_expect_success GPG 'git tag --no-sign configured tag.gpgsign skip GPG sign' '\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 '\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 \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 \\\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@@ -1168,8 +1126,7 @@ test_expect_success GPG 'verifying a forged tag with --format should fail silent\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+test_expect_success GPG 'creating a signed tag with an empty -m message should succeed' '\n \tgit tag -s -m \"\" empty-signed-tag &&\n \tget_tag_msg empty-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1179,8 +1136,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag with an empty -F messagefile should succeed' '\n \tgit tag -s -F sigemptyfile emptyfile-signed-tag &&\n \tget_tag_msg emptyfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1202,8 +1158,7 @@ Trailing spaces\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+test_expect_success GPG 'extra blanks in the message for a signed tag should be removed' '\n \tgit tag -s -F sigblanksfile blanks-signed-tag &&\n \tget_tag_msg blanks-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1212,8 +1167,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag with a blank -m message should succeed' '\n \tgit tag -s -m \"     \" blank-signed-tag &&\n \tget_tag_msg blank-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1225,8 +1179,7 @@ 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+test_expect_success GPG 'creating a signed tag with blank -F file with spaces should succeed' '\n \tgit tag -s -F sigblankfile blankfile-signed-tag &&\n \tget_tag_msg blankfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1236,8 +1189,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag with spaces and no newline should succeed' '\n \tgit tag -s -F sigblanknonlfile blanknonlfile-signed-tag &&\n \tget_tag_msg blanknonlfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1284,8 +1236,7 @@ Another line.\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+test_expect_success GPG 'creating a signed tag with a -F file with #comments should succeed' '\n \tgit tag -s -F sigcommentsfile comments-signed-tag &&\n \tget_tag_msg comments-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1294,8 +1245,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag with #commented -m message should succeed' '\n \tgit tag -s -m \"#comment\" comment-signed-tag &&\n \tget_tag_msg comment-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1307,8 +1257,7 @@ 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+test_expect_success GPG 'creating a signed tag with #commented -F messagefile should succeed' '\n \tgit tag -s -F sigcommentfile commentfile-signed-tag &&\n \tget_tag_msg commentfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1318,8 +1267,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag with a #comment and no newline should succeed' '\n \tgit tag -s -F sigcommentnonlfile commentnonlfile-signed-tag &&\n \tget_tag_msg commentnonlfile-signed-tag >actual &&\n \ttest_cmp expect actual &&\n@@ -1328,8 +1276,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@@ -1353,8 +1300,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@@ -1381,8 +1327,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'listing many message lines of a signed tag should succeed' '\n \tgit tag -s -F sigtagmsg stag-lines &&\n \n \techo \"stag-lines\" >expect &&\n@@ -1431,8 +1376,7 @@ tag=$(git rev-parse signed-tag 2>/dev/null)\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+test_expect_success GPG 'creating a signed tag pointing to a tree should succeed' '\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@@ -1441,8 +1385,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag pointing to a blob should succeed' '\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@@ -1451,8 +1394,7 @@ test_expect_success GPG \\\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+test_expect_success GPG 'creating a signed tag pointing to another tag should succeed' '\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@@ -1528,16 +1470,16 @@ test_expect_success GPG,RFC1991 \\\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-\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 \\\n-\t'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@@ -1574,17 +1516,15 @@ test_expect_success GPGSM \\\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+test_expect_success GPG 'verify signed tag fails when public key is not present' '\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,8 +1535,7 @@ 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@@ -1604,8 +1543,7 @@ test_expect_success \\\n \n get_tag_header reuse $commit commit $time >expect\n echo \"An annotation to be reused\" >>expect\n-test_expect_success \\\n-\t'overwriting an annotated tag should use its previous body' '\n+test_expect_success 'overwriting an annotated tag should use its previous body' '\n \tgit tag -a -m \"An annotation to be reused\" reuse &&\n \tGIT_EDITOR=true git tag -f -a reuse &&\n \tget_tag_msg reuse >actual &&\n-- \n2.43.0\n\n"},{"id":"500017","messageId":"CAPig+cSAG4hcLRg9nAg7JGssm5Eh87-z4kWSu_RLgJZuzhyX8w@mail.gmail.com","threadId":"61898","inReplyTo":"20240804071137.30326-5-abdobngad@gmail.com","subject":"Re: [PATCH v3 4/6] [Newcomer] t7004-tag: do not prepare except outside test_expect_success","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2024-08-04T07:32:25Z","receivedAt":"2024-08-04T07:32:37Z","isPatch":true,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Sun, Aug 4, 2024 at 3:12 AM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n> do not prepare expect outside test_expect_success\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> @@ -131,10 +131,10 @@ test_expect_success 'listing all tags if one exists should succeed' '\n> -cat >expect <<EOF\n> -mytag\n> -EOF\n>  test_expect_success 'Multiple -l or --list options are equivalent to one -l option' '\n> +       cat >expect <<-\\EOF &&\n> +       mytag\n> +       EOF\n>         git tag -l -l >actual &&\n\nThis patch also changes bare `EOF` to `\\EOF` which correctly signals\nto the reader that no variable interpolation or other processing is\nhappening inside the here-doc body. Such a change of semantics is\nsignificant enough that it normally warrants mention in the commit\nmessage. In fact, often the `EOF` to `\\EOF` change would be done in\nits own commit. However, it's probably not worth a reroll in this\ncase; v3 is likely a good place to stop unless a reviewer finds a\nproblem which demands v4.\n"},{"id":"500018","messageId":"a3d28946-2ec1-4388-8eab-0ac0c5298cf6@gmail.com","threadId":"61898","inReplyTo":"CAPig+cSAG4hcLRg9nAg7JGssm5Eh87-z4kWSu_RLgJZuzhyX8w@mail.gmail.com","subject":"Re: [PATCH v3 4/6] [Newcomer] t7004-tag: do not prepare except outside test_expect_success","fromName":"AbdAlRahman Gad","fromEmail":"abdobngad@gmail.com","sentAt":"2024-08-04T09:01:14Z","receivedAt":"2024-08-04T09:01:19Z","isPatch":true,"sender":{"key":"abdobngad@gmail.com","avatar":"https://avatars.githubusercontent.com/u/89566409?v=4"},"body":"\n\nOn 8/4/24 10:32 AM, Eric Sunshine wrote:\n> On Sun, Aug 4, 2024 at 3:12 AM AbdAlRahman Gad <abdobngad@gmail.com> wrote:\n>> do not prepare expect outside test_expect_success\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>> @@ -131,10 +131,10 @@ test_expect_success 'listing all tags if one exists should succeed' '\n>> -cat >expect <<EOF\n>> -mytag\n>> -EOF\n>>   test_expect_success 'Multiple -l or --list options are equivalent to one -l option' '\n>> +       cat >expect <<-\\EOF &&\n>> +       mytag\n>> +       EOF\n>>          git tag -l -l >actual &&\n> \n> This patch also changes bare `EOF` to `\\EOF` which correctly signals\n> to the reader that no variable interpolation or other processing is\n> happening inside the here-doc body. Such a change of semantics is\n> significant enough that it normally warrants mention in the commit\n> message. In fact, often the `EOF` to `\\EOF` change would be done in\n> its own commit. However, it's probably not worth a reroll in this\n> case; v3 is likely a good place to stop unless a reviewer finds a\n> problem which demands v4.\n\nThanks for the feedback.\nI'll keep that in mind in the upcoming patches.\n"},{"id":"500032","messageId":"xmqqv80g5j7k.fsf@gitster.g","threadId":"61898","inReplyTo":"20240804071137.30326-5-abdobngad@gmail.com","subject":"Re: [PATCH v3 4/6] [Newcomer] t7004-tag: do not prepare except outside test_expect_success","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-04T16:46:55Z","receivedAt":"2024-08-04T16:47:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"There are other \"prepare for next test\" remaining even after\napplying this patch, though.\n\n> diff --git c/t/t7004-tag.sh w/t/t7004-tag.sh\n> index cfe7653317..96aa908eaf 100755\n> --- c/t/t7004-tag.sh\n> +++ w/t/t7004-tag.sh\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>  \ttest_cmp expect actual &&\n>  \tgit tag --list -l --list >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nGood.\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>  \tgit tag -l >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nGood too.\n\n>  # creating annotated tags:\n>  \n>  get_tag_msg () {\n>  \tgit cat-file tag \"$1\" | sed -e \"/BEGIN PGP/q\"\n>  }\n>  \n>  # run test_tick before committing always gives the time in that timezone\n>  get_tag_header () {\n>  cat <<EOF\n>  object $2\n>  type $3\n>  tag $1\n>  tagger C O Mitter <committer@example.com> $4 -0700\n>  \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>  \tgit tag -m \"A message\" annotated-tag &&\n>  \tget_tag_msg annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nThe creation of $commit, holding the timestamp in $time, calling the\nget_tag_header helper helper function, and addition of the message\nto 'expect' file.  Moving all of them inside expect_success block is\nperfectly in line with the theme of this step.\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>  test_expect_success \\\n> ...\n\nDitto here.  In addition, there is a blank line lacking after the\nabove test piece and before the next one.\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>  \tgit tag -F msgfile file-annotated-tag &&\n>  \tget_tag_msg file-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  test_expect_success \\\n>  \t'creating an annotated tag with -F messagefile --edit should succeed' '\n>  \tGIT_EDITOR=./fakeeditor git tag -F msgfile --edit file-annotated-tag-edit &&\n>  \tget_tag_msg file-annotated-tag-edit >actual &&\n>  \ttest_cmp expect actual\n>  '\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>  \tgit tag -F - stdin-annotated-tag <inputmsg &&\n>  \tget_tag_msg stdin-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  \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>  \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>  \n>  Repeated blank lines\n>  \n>  Trailing spaces\n>  \n>  Trailing blank lines\n>  EOF\n>  test_expect_success \\\n>  \t'extra blanks in the message for an annotated tag should be removed' '\n>  \tgit tag -F blanksfile blanks-annotated-tag &&\n>  \tget_tag_msg blanks-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  \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>  \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>  \tgit tag -F blanknonlfile blanknonlfile-annotated-tag &&\n>  \tget_tag_msg blanknonlfile-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n>  \n>  # messages with commented lines:\n>  \n>  cat >commentsfile <<EOF\n>  # A comment\n>  \n>  ############\n>  The message.\n>  ############\n>  One line.\n>  \n>  \n>  # commented lines\n>  # commented lines\n>  \n>  Another line.\n>  # 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>  \n>  Another line.\n>  \n>  Last line.\n>  EOF\n>  test_expect_success \\\n>  \t'creating a tag using a -F messagefile with #comments should succeed' '\n>  \tgit tag -F commentsfile comments-annotated-tag &&\n>  \tget_tag_msg comments-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  \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>  \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>  \tgit tag -F commentnonlfile commentnonlfile-annotated-tag &&\n>  \tget_tag_msg commentnonlfile-annotated-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  \tgit tag -F annotagmsg tag-lines &&\n>  ...\n\nDitto.\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>  \tgit tag -s -m \"A signed tag message\" signed-tag &&\n>  \tget_tag_msg signed-tag >actual &&\n>  \ttest_cmp expect actual\n>  '\n\nDitto.\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>  \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>  \n>  '\n\nDitto.\n\nIf it is too much to include all of the above in the same patch I\nthink it would be OK to stop at \"move prepatation of the expect file\nusing cat and here-doc into test_expect_success block\", as long as\nwe make it clear in the log message that we are drawing the line\nthere in the patch, and leaving other similar issues untouched to\nkeep the step manageably short.  Adding a new patch to clean up the\n\"other similar issues\" is entirely optional, but doing so would make\nthe series even more thorough.\n\nThanks.\n\n\n\n"},{"id":"500048","messageId":"ZrCdDHqKfwWbr_Zn@tanuki","threadId":"61898","inReplyTo":"20240804071137.30326-2-abdobngad@gmail.com","subject":"Re: [PATCH v3 1/6] [Newcomer] t7004-tag: redirection operator","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-05T09:36:12Z","receivedAt":"2024-08-05T09:36:17Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Aug 04, 2024 at 10:11:32AM +0300, AbdAlRahman Gad wrote:\n> Modernaize 't7004-tag.sh' by removing whitespace\n\ns/Modernaize/Modernize. \n\n> after the redirect operators.\n\nAlso, please note that we typically wrap commit messages after 72\ncharacters.\n\nIt would also be helpful to make the commit subject a bit more\ninformative. Right now you only say \"redirection operation\", which\ndoesn't really give the reader much of a clue what the commit does to\nthose. Better would be something like\n\n    t7004: remove space after redirect operator\n\nThis gives the reader a much better signal of what the patch does.\n\nPatrick\n"},{"id":"500049","messageId":"ZrCdK_DbYyxT2D5e@tanuki","threadId":"61898","inReplyTo":"20240804071137.30326-3-abdobngad@gmail.com","subject":"Re: [PATCH v3 2/6] [Newcomer] t7004-tag: do not lose exit status to pipe","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-05T09:36:43Z","receivedAt":"2024-08-05T09:36:48Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Aug 04, 2024 at 10:11:33AM +0300, AbdAlRahman Gad wrote:\n> split \"test-tool ... | sed\" pipeline into two commands\n> to avoid losing exit status from test-tool\n\nThe commit body should be a full sentence and thus should start with an\nupper-case letter and end with punctuation.\n\nI'd also drop the \"-tag\" from \"t7004-tag\" in the commit subject, as we\ntypically only mention the tag number.\n\nPatrick\n"},{"id":"500050","messageId":"ZrCdME2Q7gT0KDrr@tanuki","threadId":"61898","inReplyTo":"20240804071137.30326-4-abdobngad@gmail.com","subject":"Re: [PATCH v3 3/6] [Newcomer] t7004-tag: one command per line","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-05T09:36:48Z","receivedAt":"2024-08-05T09:36:52Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Aug 04, 2024 at 10:11:34AM +0300, AbdAlRahman Gad wrote:\n> fix lines like these:\n> \n> git tag -l >actual && test_cmp expect actual &&\n> \n> to\n> \n> git tag -l >actual &&\n> test_cmp expect actual &&\n\nSame remark here regarding the style of this commit message. I also\nthink that the message is both overly verbose and not telling enough at\nthe same point in time, because you require the reader to implicitly\nderive what the change is that you are doing. Proposal:\n\n    One of the tests in t7004 has multiple commands on a single line,\n    which is discouraged. Adapt these by splitting up these into one\n    line per command.\n\nPatrick\n"},{"id":"500051","messageId":"ZrCeaU4VKxPYTPiJ@tanuki","threadId":"61898","inReplyTo":"20240804071137.30326-6-abdobngad@gmail.com","subject":"Re: [PATCH v3 5/6] [Newcomer] t7004-tag: here-doc modernization","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-05T09:42:01Z","receivedAt":"2024-08-05T09:42:05Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Aug 04, 2024 at 10:11:36AM +0300, AbdAlRahman Gad wrote:\n> use <<-\\EOF to indent here-doc\n\nInstead of what? It would help to mention that the change converts from\n<<\\EOF to <<\\-EOF, where the latter allows us to indent the body.\n\nI'd also suggest a commit title like \"t7004: use indented here docs\", as\n\"here doc modernizations\" doesn't quite give you a hint what the\nmodernization looks like.\n\nPatrick\n"},{"id":"500052","messageId":"ZrCebm52L16N2Agu@tanuki","threadId":"61898","inReplyTo":"20240804071137.30326-7-abdobngad@gmail.com","subject":"Re: [PATCH v3 6/6] [Newcomer] t7004-tag: description on the same line as test_expect_success","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2024-08-05T09:42:06Z","receivedAt":"2024-08-05T09:42:10Z","isPatch":true,"sender":{"key":"ps@pks.im","avatar":"https://avatars.githubusercontent.com/u/4056630?v=4"},"body":"On Sun, Aug 04, 2024 at 10:11:37AM +0300, AbdAlRahman Gad wrote:\n> changed test_expect_success that are seperated from its name like:\n\nWe do not say \"changed something to something\", but rather use\nimperative wording as if we were instructing the code itself to change.\nSo maybe something like the following:\n\n    There are several tests in t7004 where the test description that\n    follows `test_expect_success` is on a separate line, violating our\n    coding style. Adapt these to be on the same line.\n\nPatrick\n"}]}