{"thread":{"id":"25097","subject":"[PATCH] tests: use test_cmp instead of piping to diff(1)","startedAt":"2010-09-13T20:59:42Z","lastAt":"2010-09-15T23:15:36Z","messageCount":5,"participants":["Ævar Arnfjörð Bjarmason","Junio C Hamano","Jens Lehmann"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"150630","messageId":"1284411582-1088-1-git-send-email-avarab@gmail.com","threadId":"25097","inReplyTo":null,"subject":"[PATCH] tests: use test_cmp instead of piping to diff(1)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-13T20:59:42Z","receivedAt":"2010-09-13T20:59:42Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"Change submodule tests that piped to diff(1) to use test_cmp. The\nresulting unified diff is easier to read.\n\nSigned-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>\n---\n t/t4041-diff-submodule-option.sh |   96 +++++++++++++++++++++++++-------------\n t/t7401-submodule-summary.sh     |   45 ++++++++++++------\n 2 files changed, 94 insertions(+), 47 deletions(-)\n\ndiff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh\nindex 8e391cf..36a8a41 100755\n--- a/t/t4041-diff-submodule-option.sh\n+++ b/t/t4041-diff-submodule-option.sh\n@@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)\n test_expect_success 'added submodule' \"\n \tgit add sm1 &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 0000000...$head1 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -47,33 +48,36 @@ head2=$(add_file sm1 foo3)\n \n test_expect_success 'modified submodule(forward)' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head1..$head2:\n   > Add foo3\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule(forward)' \"\n \tgit diff --submodule=log >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head1..$head2:\n   > Add foo3\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule(forward) --submodule' \"\n \tgit diff --submodule >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head1..$head2:\n   > Add foo3\n EOF\n+    test_cmp expected actual\n \"\n \n fullhead1=$(cd sm1; git rev-list --max-count=1 $head1)\n fullhead2=$(cd sm1; git rev-list --max-count=1 $head2)\n test_expect_success 'modified submodule(forward) --submodule=short' \"\n \tgit diff --submodule=short >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n diff --git a/sm1 b/sm1\n index $head1..$head2 160000\n --- a/sm1\n@@ -82,6 +86,7 @@ index $head1..$head2 160000\n -Subproject commit $fullhead1\n +Subproject commit $fullhead2\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -92,24 +97,26 @@ cd ..\n \n test_expect_success 'modified submodule(backward)' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head2..$head3 (rewind):\n   < Add foo3\n   < Add foo2\n EOF\n+    test_cmp expected actual\n \"\n \n head4=$(add_file sm1 foo4 foo5) &&\n head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)\n test_expect_success 'modified submodule(backward and forward)' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head2...$head4:\n   > Add foo5\n   > Add foo4\n   < Add foo3\n   < Add foo2\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -122,7 +129,7 @@ mv sm1-bak sm1\n \n test_expect_success 'typechanged submodule(submodule->blob), --cached' \"\n \tgit diff --submodule=log --cached >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 41fbea9...0000000 (submodule deleted)\n diff --git a/sm1 b/sm1\n new file mode 100644\n@@ -132,11 +139,12 @@ index 0000000..9da5fb8\n @@ -0,0 +1 @@\n +sm1\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'typechanged submodule(submodule->blob)' \"\n \tgit diff --submodule=log >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n diff --git a/sm1 b/sm1\n deleted file mode 100644\n index 9da5fb8..0000000\n@@ -146,13 +154,14 @@ index 9da5fb8..0000000\n -sm1\n Submodule sm1 0000000...$head4 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n rm -rf sm1 &&\n git checkout-index sm1\n test_expect_success 'typechanged submodule(submodule->blob)' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head4...0000000 (submodule deleted)\n diff --git a/sm1 b/sm1\n new file mode 100644\n@@ -162,6 +171,7 @@ index 0000000..$head5\n @@ -0,0 +1 @@\n +sm1\n EOF\n+    test_cmp expected actual\n \"\n \n rm -f sm1 &&\n@@ -170,15 +180,16 @@ head6=$(add_file sm1 foo6 foo7)\n fullhead6=$(cd sm1; git rev-list --max-count=1 $head6)\n test_expect_success 'nonexistent commit' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head4...$head6 (commits not present)\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file\n test_expect_success 'typechanged submodule(blob->submodule)' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n diff --git a/sm1 b/sm1\n deleted file mode 100644\n index $head5..0000000\n@@ -188,21 +199,24 @@ index $head5..0000000\n -sm1\n Submodule sm1 0000000...$head6 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n test_expect_success 'submodule is up to date' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'submodule contains untracked content' \"\n \techo new > sm1/new-file &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains untracked content\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'submodule contains untracked content (untracked ignored)' \"\n@@ -223,18 +237,20 @@ test_expect_success 'submodule contains untracked content (all ignored)' \"\n test_expect_success 'submodule contains untracked and modifed content' \"\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains untracked content\n Submodule sm1 contains modified content\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'submodule contains untracked and modifed content (untracked ignored)' \"\n \techo new > sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains modified content\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' \"\n@@ -252,45 +268,50 @@ test_expect_success 'submodule contains untracked and modifed content (all ignor\n test_expect_success 'submodule contains modifed content' \"\n \trm -f sm1/new-file &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains modified content\n EOF\n+    test_cmp expected actual\n \"\n \n (cd sm1; git commit -mchange foo6 >/dev/null) &&\n head8=$(cd sm1; git rev-parse --verify HEAD | cut -c1-7) &&\n test_expect_success 'submodule is modified' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked content' \"\n \techo new > sm1/new-file &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains untracked content\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked content (untracked ignored)' \"\n \tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked content (dirty ignored)' \"\n \tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked content (all ignored)' \"\n@@ -301,31 +322,34 @@ test_expect_success 'modified submodule contains untracked content (all ignored)\n test_expect_success 'modified submodule contains untracked and modifed content' \"\n \techo modification >> sm1/foo6 &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains untracked content\n Submodule sm1 contains modified content\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked and modifed content (untracked ignored)' \"\n \techo modification >> sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains modified content\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked and modifed content (dirty ignored)' \"\n \techo modification >> sm1/foo6 &&\n \tgit diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' \"\n@@ -337,19 +361,21 @@ test_expect_success 'modified submodule contains untracked and modifed content (\n test_expect_success 'modified submodule contains modifed content' \"\n \trm -f sm1/new-file &&\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 contains modified content\n Submodule sm1 $head6..$head8:\n   > change\n EOF\n+    test_cmp expected actual\n \"\n \n rm -rf sm1\n test_expect_success 'deleted submodule' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6...0000000 (submodule deleted)\n EOF\n+    test_cmp expected actual\n \"\n \n test_create_repo sm2 &&\n@@ -358,41 +384,45 @@ git add sm2\n \n test_expect_success 'multiple submodules' \"\n \tgit diff-index -p --submodule=log HEAD >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6...0000000 (submodule deleted)\n Submodule sm2 0000000...$head7 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'path filter' \"\n \tgit diff-index -p --submodule=log HEAD sm2 >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm2 0000000...$head7 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm2\n test_expect_success 'given commit' \"\n \tgit diff-index -p --submodule=log HEAD^ >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6...0000000 (submodule deleted)\n Submodule sm2 0000000...$head7 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'given commit --submodule' \"\n \tgit diff-index -p --submodule HEAD^ >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6...0000000 (submodule deleted)\n Submodule sm2 0000000...$head7 (new submodule)\n EOF\n+    test_cmp expected actual\n \"\n \n fullhead7=$(cd sm2; git rev-list --max-count=1 $head7)\n \n test_expect_success 'given commit --submodule=short' \"\n \tgit diff-index -p --submodule=short HEAD^ >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n diff --git a/sm1 b/sm1\n deleted file mode 160000\n index $head6..0000000\n@@ -408,6 +438,7 @@ index 0000000..$head7\n @@ -0,0 +1 @@\n +Subproject commit $fullhead7\n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'setup .git file for sm2' '\n@@ -419,10 +450,11 @@ test_expect_success 'setup .git file for sm2' '\n \n test_expect_success 'diff --submodule with .git file' '\n \tgit diff --submodule HEAD^ >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n Submodule sm1 $head6...0000000 (submodule deleted)\n Submodule sm2 0000000...$head7 (new submodule)\n EOF\n+    test_cmp expected actual\n '\n \n test_done\ndiff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh\nindex cee319d..6a320cc 100755\n--- a/t/t7401-submodule-summary.sh\n+++ b/t/t7401-submodule-summary.sh\n@@ -37,11 +37,12 @@ head1=$(add_file sm1 foo1 foo2)\n test_expect_success 'added submodule' \"\n \tgit add sm1 &&\n \tgit submodule summary >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n * sm1 0000000...$head1 (2):\n   > Add foo2\n \n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -49,20 +50,22 @@ head2=$(add_file sm1 foo3)\n \n test_expect_success 'modified submodule(forward)' \"\n \tgit submodule summary >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n * sm1 $head1...$head2 (1):\n   > Add foo3\n \n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'modified submodule(forward), --files' \"\n \tgit submodule summary --files >actual &&\n-\tdiff actual - <<-EOF\n+\tcat >expected <<-EOF &&\n * sm1 $head1...$head2 (1):\n   > Add foo3\n \n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -73,19 +76,20 @@ cd ..\n \n test_expect_success 'modified submodule(backward)' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head2...$head3 (2):\n   < Add foo3\n   < Add foo2\n \n EOF\n+    test_cmp expected actual\n \"\n \n head4=$(add_file sm1 foo4 foo5) &&\n head4_full=$(GIT_DIR=sm1/.git git rev-parse --verify HEAD)\n test_expect_success 'modified submodule(backward and forward)' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head2...$head4 (4):\n   > Add foo5\n   > Add foo4\n@@ -93,17 +97,19 @@ test_expect_success 'modified submodule(backward and forward)' \"\n   < Add foo2\n \n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success '--summary-limit' \"\n     git submodule summary -n 3 >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head2...$head4 (4):\n   > Add foo5\n   > Add foo4\n   < Add foo3\n \n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n@@ -116,30 +122,33 @@ mv sm1-bak sm1\n \n test_expect_success 'typechanged submodule(submodule->blob), --cached' \"\n     git submodule summary --cached >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head4(submodule)->$head5(blob) (3):\n   < Add foo5\n \n EOF\n+    test_cmp actual expected\n \"\n \n test_expect_success 'typechanged submodule(submodule->blob), --files' \"\n     git submodule summary --files >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head5(blob)->$head4(submodule) (3):\n   > Add foo5\n \n EOF\n+    test_cmp actual expected\n \"\n \n rm -rf sm1 &&\n git checkout-index sm1\n test_expect_success 'typechanged submodule(submodule->blob)' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head4(submodule)->$head5(blob):\n \n EOF\n+    test_cmp actual expected\n \"\n \n rm -f sm1 &&\n@@ -147,31 +156,34 @@ test_create_repo sm1 &&\n head6=$(add_file sm1 foo6 foo7)\n test_expect_success 'nonexistent commit' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head4...$head6:\n   Warn: sm1 doesn't contain commit $head4_full\n \n EOF\n+    test_cmp actual expected\n \"\n \n commit_file\n test_expect_success 'typechanged submodule(blob->submodule)' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head5(blob)->$head6(submodule) (2):\n   > Add foo7\n \n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm1 &&\n rm -rf sm1\n test_expect_success 'deleted submodule' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head6...0000000:\n \n EOF\n+    test_cmp expected actual\n \"\n \n test_create_repo sm2 &&\n@@ -180,34 +192,37 @@ git add sm2\n \n test_expect_success 'multiple submodules' \"\n     git submodule summary >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head6...0000000:\n \n * sm2 0000000...$head7 (2):\n   > Add foo9\n \n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success 'path filter' \"\n     git submodule summary sm2 >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm2 0000000...$head7 (2):\n   > Add foo9\n \n EOF\n+    test_cmp expected actual\n \"\n \n commit_file sm2\n test_expect_success 'given commit' \"\n     git submodule summary HEAD^ >actual &&\n-    diff actual - <<-EOF\n+    cat >expected <<-EOF &&\n * sm1 $head6...0000000:\n \n * sm2 0000000...$head7 (2):\n   > Add foo9\n \n EOF\n+    test_cmp expected actual\n \"\n \n test_expect_success '--for-status' \"\n-- \n1.7.3.rc1.121.g9cd82\n"},{"id":"150653","messageId":"7vy6b59q5a.fsf@alter.siamese.dyndns.org","threadId":"25097","inReplyTo":"1284411582-1088-1-git-send-email-avarab@gmail.com","subject":"Re: [PATCH] tests: use test_cmp instead of piping to diff(1)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-13T23:31:45Z","receivedAt":"2010-09-13T23:31:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n\n> @@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)\n>  test_expect_success 'added submodule' \"\n>  \tgit add sm1 &&\n>  \tgit diff-index -p --submodule=log HEAD >actual &&\n> -\tdiff actual - <<-EOF\n> +\tcat >expected <<-EOF &&\n>  Submodule sm1 0000000...$head1 (new submodule)\n>  EOF\n> +    test_cmp expected actual\n>  \"\n\nNit.  Did you really mean <<-EOF, not <<EOF, here, especially you are\nwriting the here document without indentation with any TAB?\n"},{"id":"150659","messageId":"AANLkTinGt6d8tKh8yOT0SJpcgsv+KgrE4jPT2_RgGzeG@mail.gmail.com","threadId":"25097","inReplyTo":"7vy6b59q5a.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] tests: use test_cmp instead of piping to diff(1)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-14T01:45:24Z","receivedAt":"2010-09-14T01:45:24Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Mon, Sep 13, 2010 at 23:31, Junio C Hamano <gitster@pobox.com> wrote:\n> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>\n>> @@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)\n>>  test_expect_success 'added submodule' \"\n>>       git add sm1 &&\n>>       git diff-index -p --submodule=log HEAD >actual &&\n>> -     diff actual - <<-EOF\n>> +     cat >expected <<-EOF &&\n>>  Submodule sm1 0000000...$head1 (new submodule)\n>>  EOF\n>> +    test_cmp expected actual\n>>  \"\n>\n> Nit.  Did you really mean <<-EOF, not <<EOF, here, especially you are\n> writing the here document without indentation with any TAB?\n\nI just meant to replace the diff invocations with test_cmp. Changing\nthe surrounding here-docs was outside the scope of the patch.\n"},{"id":"150717","messageId":"4C90029F.6020909@web.de","threadId":"25097","inReplyTo":"AANLkTinGt6d8tKh8yOT0SJpcgsv+KgrE4jPT2_RgGzeG@mail.gmail.com","subject":"Re: [PATCH] tests: use test_cmp instead of piping to diff(1)","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2010-09-14T23:17:51Z","receivedAt":"2010-09-14T23:17:51Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Am 14.09.2010 03:45, schrieb Ævar Arnfjörð Bjarmason:\n> On Mon, Sep 13, 2010 at 23:31, Junio C Hamano <gitster@pobox.com> wrote:\n>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>>\n>>> @@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)\n>>>  test_expect_success 'added submodule' \"\n>>>       git add sm1 &&\n>>>       git diff-index -p --submodule=log HEAD >actual &&\n>>> -     diff actual - <<-EOF\n>>> +     cat >expected <<-EOF &&\n>>>  Submodule sm1 0000000...$head1 (new submodule)\n>>>  EOF\n>>> +    test_cmp expected actual\n>>>  \"\n>>\n>> Nit.  Did you really mean <<-EOF, not <<EOF, here, especially you are\n>> writing the here document without indentation with any TAB?\n> \n> I just meant to replace the diff invocations with test_cmp. Changing\n> the surrounding here-docs was outside the scope of the patch.\n\nI plead guilty for introducing the \"<<-EOF\"s in the first place by\nsimply copying the frame for this test from t7401. But me too thinks\nthe \"test_cmp\" should have TABs in front of them instead of spaces.\n\nWith the \"TAB in front of test_cmp\" issue fixed you may add:\nAcked-by: Jens Lehmann <Jens.Lehmann@web.de>\n"},{"id":"150770","messageId":"AANLkTimpV20yGKw57raxho-8zSymLEvXgXSAayEmb7M9@mail.gmail.com","threadId":"25097","inReplyTo":"4C90029F.6020909@web.de","subject":"Re: [PATCH] tests: use test_cmp instead of piping to diff(1)","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2010-09-15T23:15:36Z","receivedAt":"2010-09-15T23:15:36Z","isPatch":true,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Tue, Sep 14, 2010 at 23:17, Jens Lehmann <Jens.Lehmann@web.de> wrote:\n> Am 14.09.2010 03:45, schrieb Ævar Arnfjörð Bjarmason:\n>> On Mon, Sep 13, 2010 at 23:31, Junio C Hamano <gitster@pobox.com> wrote:\n>>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:\n>>>\n>>>> @@ -37,9 +37,10 @@ head1=$(add_file sm1 foo1 foo2)\n>>>>  test_expect_success 'added submodule' \"\n>>>>       git add sm1 &&\n>>>>       git diff-index -p --submodule=log HEAD >actual &&\n>>>> -     diff actual - <<-EOF\n>>>> +     cat >expected <<-EOF &&\n>>>>  Submodule sm1 0000000...$head1 (new submodule)\n>>>>  EOF\n>>>> +    test_cmp expected actual\n>>>>  \"\n>>>\n>>> Nit.  Did you really mean <<-EOF, not <<EOF, here, especially you are\n>>> writing the here document without indentation with any TAB?\n>>\n>> I just meant to replace the diff invocations with test_cmp. Changing\n>> the surrounding here-docs was outside the scope of the patch.\n>\n> I plead guilty for introducing the \"<<-EOF\"s in the first place by\n> simply copying the frame for this test from t7401. But me too thinks\n> the \"test_cmp\" should have TABs in front of them instead of spaces.\n>\n> With the \"TAB in front of test_cmp\" issue fixed you may add:\n> Acked-by: Jens Lehmann <Jens.Lehmann@web.de>\n\nJunio, since you picked this up as part of the ab/i18n branch I fixed\nthis issue up there. You can pull it from the usual place\n(git://github.com/avar/git.git ab/i18n).\n\nI didn't switch to TAB in all cases, but only the ones where the\nsurrounding test code already used TAB. t4041-diff-submodule-option.sh\nuses TAB for indent, but t7401-submodule-summary.sh does not, this way\nmy patch retains the indentation of the surrounding code.\n\n(I didn't add Jens's Acked-by to the patch since I didn't strictly do\nwhat he was suggesting).\n"}]}