t4014: use indentable here-docs
authorDenton Liu <liu.denton@gmail.com>
Tue, 27 Aug 2019 04:05:03 +0000 (00:05 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Sep 2019 19:58:52 +0000 (12:58 -0700)
The convention is to use indentable here-docs within test cases so that
the here-docs line up with the rest of the code within the test case.
Change here-docs from `<<\EOF` to `<<-\EOF` so that they can be indented
along with the rest of the test case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t4014-format-patch.sh
index 075affb1e5ca31b003228d634756678601180cd5..c07d868491bbbd2887931d8afd19d662a4ac5272 100755 (executable)
@@ -1211,282 +1211,282 @@ append_signoff()
 
 test_expect_success 'signoff: commit with no body' '
        append_signoff </dev/null >actual &&
-       cat <<\EOF | sed "s/EOL$//" >expect &&
-4:Subject: [PATCH] EOL
-8:
-9:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       cat <<-\EOF | sed "s/EOL$//" >expect &&
+       4:Subject: [PATCH] EOL
+       8:
+       9:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: commit with only subject' '
        echo subject | append_signoff >actual &&
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-9:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       9:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: commit with only subject that does not end with NL' '
        printf subject | append_signoff >actual &&
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-9:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       9:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: no existing signoffs' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       body
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: no existing signoffs and no trailing NL' '
        printf "subject\n\nbody" | append_signoff >actual &&
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: some random signoff' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Signed-off-by: my@house
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: my@house
-12:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Signed-off-by: my@house
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: my@house
+       12:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: misc conforming footer elements' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Signed-off-by: my@house
-(cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
-Tested-by: Some One <someone@example.com>
-Bug: 1234
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: my@house
-15:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Signed-off-by: my@house
+       (cherry picked from commit da39a3ee5e6b4b0d3255bfef95601890afd80709)
+       Tested-by: Some One <someone@example.com>
+       Bug: 1234
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: my@house
+       15:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: some random signoff-alike' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
-Fooled-by-me: my@house
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-11:
-12:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       body
+       Fooled-by-me: my@house
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       11:
+       12:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: not really a signoff' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-I want to mention about Signed-off-by: here.
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-9:I want to mention about Signed-off-by: here.
-10:
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       I want to mention about Signed-off-by: here.
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       9:I want to mention about Signed-off-by: here.
+       10:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: not really a signoff (2)' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-My unfortunate
-Signed-off-by: example happens to be wrapped here.
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:Signed-off-by: example happens to be wrapped here.
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       My unfortunate
+       Signed-off-by: example happens to be wrapped here.
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:Signed-off-by: example happens to be wrapped here.
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: valid S-o-b paragraph in the middle' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-Signed-off-by: my@house
-Signed-off-by: your@house
+       Signed-off-by: my@house
+       Signed-off-by: your@house
 
-A lot of houses.
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-9:Signed-off-by: my@house
-10:Signed-off-by: your@house
-11:
-13:
-14:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       A lot of houses.
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       9:Signed-off-by: my@house
+       10:Signed-off-by: your@house
+       11:
+       13:
+       14:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: the same signoff at the end' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Signed-off-by: C O Mitter <committer@example.com>
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Signed-off-by: C O Mitter <committer@example.com>
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: the same signoff at the end, no trailing NL' '
        printf "subject\n\nSigned-off-by: C O Mitter <committer@example.com>" |
                append_signoff >actual &&
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-9:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       9:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: the same signoff NOT at the end' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Signed-off-by: C O Mitter <committer@example.com>
-Signed-off-by: my@house
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-11:Signed-off-by: C O Mitter <committer@example.com>
-12:Signed-off-by: my@house
-EOF
+       Signed-off-by: C O Mitter <committer@example.com>
+       Signed-off-by: my@house
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       12:Signed-off-by: my@house
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: tolerate garbage in conforming footer' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Tested-by: my@house
-Some Trash
-Signed-off-by: C O Mitter <committer@example.com>
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-13:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Tested-by: my@house
+       Some Trash
+       Signed-off-by: C O Mitter <committer@example.com>
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       13:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: respect trailer config' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-Myfooter: x
-Some Trash
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-11:
-12:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Myfooter: x
+       Some Trash
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       11:
+       12:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual &&
 
        test_config trailer.Myfooter.ifexists add &&
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-Myfooter: x
-Some Trash
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-11:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Myfooter: x
+       Some Trash
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       11:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '
 
 test_expect_success 'signoff: footer begins with non-signoff without @ sign' '
-       append_signoff <<\EOF >actual &&
-subject
+       append_signoff <<-\EOF >actual &&
+       subject
 
-body
+       body
 
-Reviewed-id: Noone
-Tested-by: my@house
-Change-id: Ideadbeef
-Signed-off-by: C O Mitter <committer@example.com>
-Bug: 1234
-EOF
-       cat >expect <<\EOF &&
-4:Subject: [PATCH] subject
-8:
-10:
-14:Signed-off-by: C O Mitter <committer@example.com>
-EOF
+       Reviewed-id: Noone
+       Tested-by: my@house
+       Change-id: Ideadbeef
+       Signed-off-by: C O Mitter <committer@example.com>
+       Bug: 1234
+       EOF
+       cat >expect <<-\EOF &&
+       4:Subject: [PATCH] subject
+       8:
+       10:
+       14:Signed-off-by: C O Mitter <committer@example.com>
+       EOF
        test_cmp expect actual
 '