{"thread":{"id":"49302","subject":"[PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","startedAt":"2018-09-07T23:23:06Z","lastAt":"2018-09-18T01:55:36Z","messageCount":8,"participants":["Todd Zullinger","Jeff King","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"357667","messageId":"20180907232205.31328-1-tmz@pobox.com","threadId":"49302","inReplyTo":null,"subject":"[PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2018-09-07T23:22:05Z","receivedAt":"2018-09-07T23:23:06Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"With curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output\nused in the 'cookies stored in http.cookiefile when http.savecookies\nset' test before comparing it to the expected cookies.\n\n¹ https://github.com/curl/curl/commit/e2ef8d6fa (\"cookies: support\n  creation-time attribute for cookies\", 2018-08-28)\n\nSigned-off-by: Todd Zullinger <tmz@pobox.com>\n---\n[Resending with the list in Cc; sorry for spamming you,\nJunio, Jeff, and Gábor.]\n\nThe in-development version of Fedora updated to the recently\nreleased curl-7.61.1 in the past few days.  This isn't\nbreakage from the 2.19.0 cycle, but if the fix looks good to\neveryone it would be nice to include it.  That way other\ndistributions and users who update git and curl to the most\nrecent releases won't run into this test failure.\n\nI tested this against Fedora 30 (curl-7.61.1) as well as\nprevious releases from RHEL/CentOS 6/7 (7.19.7/7.29.0) and\nFedora 27/28/29 (7.55.1/7.59.0/7.61.0).\n\nThe verbose output is:\n\nexpecting success:\n\tgit config http.cookiefile cookies.txt &&\n\tgit config http.savecookies true &&\n\tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n\ttail -3 cookies.txt >cookies_tail.txt &&\n\ttest_cmp expect_cookies.txt cookies_tail.txt\n++ git config http.cookiefile cookies.txt\n++ git config http.savecookies true\n++ git ls-remote http://127.0.0.1:5551/smart_cookies/repo.git master\n7ae89caac6c721f16555e981eaeed64abc165c5d\trefs/heads/master\n263207bb5fbfbefbdf1c9c3fa4ae5d9663323217\trefs/namespaces/ns/refs/heads/master\n++ tail -3 cookies.txt\n++ test_cmp expect_cookies.txt cookies_tail.txt\n++ diff -u expect_cookies.txt cookies_tail.txt\n--- expect_cookies.txt\t2018-09-07 07:29:05.231532462 +0000\n+++ cookies_tail.txt\t2018-09-07 07:29:05.306532366 +0000\n@@ -1,3 +1,3 @@\n\n-127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n 127.0.0.1\tFALSE\t/smart_cookies/repo.git/info/\tFALSE\t0\tname\tvalue\n+127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\nerror: last command exited with $?=1\nnot ok 22 - cookies stored in http.cookiefile when http.savecookies set\n\n t/t5551-http-fetch-smart.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\nindex 771f36f9ff..538656bfef 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n \tgit config http.cookiefile cookies.txt &&\n \tgit config http.savecookies true &&\n \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n-\ttail -3 cookies.txt >cookies_tail.txt &&\n+\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n \ttest_cmp expect_cookies.txt cookies_tail.txt\n '\n \n-- \n2.19.0.rc2\n\n"},{"id":"357669","messageId":"20180907235508.GB32065@sigill.intra.peff.net","threadId":"49302","inReplyTo":"20180907232205.31328-1-tmz@pobox.com","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-09-07T23:55:09Z","receivedAt":"2018-09-07T23:55:12Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Sep 07, 2018 at 07:22:05PM -0400, Todd Zullinger wrote:\n\n> With curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output\n> used in the 'cookies stored in http.cookiefile when http.savecookies\n> set' test before comparing it to the expected cookies.\n> \n> ¹ https://github.com/curl/curl/commit/e2ef8d6fa (\"cookies: support\n>   creation-time attribute for cookies\", 2018-08-28)\n\nAccording to that commit message, the creation-time sort is only for\ncookies of the same length. But it's not clear to me if that just means\non-the-wire, and curl always stores by creation-time in the cookie file.\n\nEither way, though, I guess it wouldn't matter for us as long as we\nchoose some arbitrary re-ordering for what curl produces (i.e., the\noutput of `sort`) and then make sure our \"expect\" output is in the same\norder. Which is basically what your patch does. One question, though:\n\n> diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\n> index 771f36f9ff..538656bfef 100755\n> --- a/t/t5551-http-fetch-smart.sh\n> +++ b/t/t5551-http-fetch-smart.sh\n> @@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n>  \tgit config http.cookiefile cookies.txt &&\n>  \tgit config http.savecookies true &&\n>  \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n> -\ttail -3 cookies.txt >cookies_tail.txt &&\n> +\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n>  \ttest_cmp expect_cookies.txt cookies_tail.txt\n>  '\n\nWe pick the bottom 3 before sorting. How do we know those are the three\nwe want to see?\n\n...Ah, OK. The lines we are skipping are not actually cookies at all,\nbut just header cruft. I wonder if:\n\n  grep \"^[^#]\" cookies.txt\n\nwould be a better way of doing that, but that is certainly not something\nnew.\n\nSo this fix looks fine. It might be worth a comment above the creation\nof expect_cookies.txt to mention it must be in sorted order (of course\nanybody modifying it would see a test failure).\n\n> The in-development version of Fedora updated to the recently\n> released curl-7.61.1 in the past few days.  This isn't\n> breakage from the 2.19.0 cycle, but if the fix looks good to\n> everyone it would be nice to include it.  That way other\n> distributions and users who update git and curl to the most\n> recent releases won't run into this test failure.\n> \n> I tested this against Fedora 30 (curl-7.61.1) as well as\n> previous releases from RHEL/CentOS 6/7 (7.19.7/7.29.0) and\n> Fedora 27/28/29 (7.55.1/7.59.0/7.61.0).\n\nYou're pretty late in the 2.19 cycle, since the release is tentatively\nscheduled for Sunday. Though since this is just touching the test\nscript, and since it looks Obviously Correct, I'm not opposed.\n\n-Peff\n"},{"id":"357675","messageId":"20180908032841.GK7192@zaya.teonanacatl.net","threadId":"49302","inReplyTo":"20180907235508.GB32065@sigill.intra.peff.net","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2018-09-08T03:28:41Z","receivedAt":"2018-09-08T03:29:20Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Jeff King wrote:\n> On Fri, Sep 07, 2018 at 07:22:05PM -0400, Todd Zullinger wrote:\n> \n>> With curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output\n>> used in the 'cookies stored in http.cookiefile when http.savecookies\n>> set' test before comparing it to the expected cookies.\n>> \n>> ¹ https://github.com/curl/curl/commit/e2ef8d6fa (\"cookies: support\n>>   creation-time attribute for cookies\", 2018-08-28)\n> \n> According to that commit message, the creation-time sort is only for\n> cookies of the same length. But it's not clear to me if that just means\n> on-the-wire, and curl always stores by creation-time in the cookie file.\n\nYeah, I didn't dig into the curl code deeply to try and\nunderstand it.  I did test with the only the curl package\ndowngraded to 7.61.0 to confirm the test worked without\nsorting.  And I saw that the curl commit updated existing\ntests to sort the test data.\n\n> Either way, though, I guess it wouldn't matter for us as long as we\n> choose some arbitrary re-ordering for what curl produces (i.e., the\n> output of `sort`) and then make sure our \"expect\" output is in the same\n> order. Which is basically what your patch does. One question, though:\n> \n>> diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\n>> index 771f36f9ff..538656bfef 100755\n>> --- a/t/t5551-http-fetch-smart.sh\n>> +++ b/t/t5551-http-fetch-smart.sh\n>> @@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n>>  \tgit config http.cookiefile cookies.txt &&\n>>  \tgit config http.savecookies true &&\n>>  \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n>> -\ttail -3 cookies.txt >cookies_tail.txt &&\n>> +\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n>>  \ttest_cmp expect_cookies.txt cookies_tail.txt\n>>  '\n> \n> We pick the bottom 3 before sorting. How do we know those are the three\n> we want to see?\n> \n> ...Ah, OK. The lines we are skipping are not actually cookies at all,\n> but just header cruft. I wonder if:\n> \n>   grep \"^[^#]\" cookies.txt\n> \n> would be a better way of doing that, but that is certainly not something\n> new.\n> \n> So this fix looks fine. It might be worth a comment above the creation\n> of expect_cookies.txt to mention it must be in sorted order (of course\n> anybody modifying it would see a test failure).\n\nI thought about running the expect_cookies.txt file through\nsort as well.  That would ensure that both files were using\nthe same sorting.  Whether that's needed on any platform\nnow, I don't know.  Maybe that would be a useful way to\nprotect against future edits to the expect_cookies.txt file\ncatching the editor?\n\nI thought there might be a test function to sort the output,\nbut I was (incorrectly) thinking of check_access_log() which\nGábor added in e8b3b2e275 (\"t/lib-httpd: avoid occasional\nfailures when checking access.log\", 2018-07-12).\n\nPerhaps it would be useful to have a test_cmp_sorted() to do\nthe simple dance of sorting the actual & expected.  I\nhaven't looked through the tests to see how often such a\nfunction might be useful.\n\n>> The in-development version of Fedora updated to the recently\n>> released curl-7.61.1 in the past few days.  This isn't\n>> breakage from the 2.19.0 cycle, but if the fix looks good to\n>> everyone it would be nice to include it.  That way other\n>> distributions and users who update git and curl to the most\n>> recent releases won't run into this test failure.\n>> \n>> I tested this against Fedora 30 (curl-7.61.1) as well as\n>> previous releases from RHEL/CentOS 6/7 (7.19.7/7.29.0) and\n>> Fedora 27/28/29 (7.55.1/7.59.0/7.61.0).\n> \n> You're pretty late in the 2.19 cycle, since the release is tentatively\n> scheduled for Sunday. Though since this is just touching the test\n> script, and since it looks Obviously Correct, I'm not opposed.\n\nYep, I knew the final was coming very soon.  I would not\nhave been surprised to see it land tonight while I was\nfinishing my testing of this patch. :)\n\nI'm certainly covered for the Fedora packages.  It's hard to\nsay whether there are many other users/packagers who might\nupgrade both git and curl and run into this.  So it may not\nbe worth even a small risk of making the change at this\npoint.\n\nOn the other hand, the change only affects one test and may\nbe safe enough to apply.  I'll leave that choice in the\ncapable hands of our maintainer and the good folks here.\n\nThanks for a thoughtful review, as always.\n\n-- \nTodd\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nThat which seems the height of absurdity in one generation often\nbecomes the height of wisdom in the next.\n    -- John Stuart Mill (1806-1873)\n\n"},{"id":"357698","messageId":"20180908161712.GA9016@sigill.intra.peff.net","threadId":"49302","inReplyTo":"20180908032841.GK7192@zaya.teonanacatl.net","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-09-08T16:17:12Z","receivedAt":"2018-09-08T16:17:16Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, Sep 07, 2018 at 11:28:41PM -0400, Todd Zullinger wrote:\n\n> > So this fix looks fine. It might be worth a comment above the creation\n> > of expect_cookies.txt to mention it must be in sorted order (of course\n> > anybody modifying it would see a test failure).\n> \n> I thought about running the expect_cookies.txt file through\n> sort as well.  That would ensure that both files were using\n> the same sorting.  Whether that's needed on any platform\n> now, I don't know.  Maybe that would be a useful way to\n> protect against future edits to the expect_cookies.txt file\n> catching the editor?\n\nYes, I think sorting the expect file would work fine. I'm OK with that,\nor just leaving a comment. The comment has the bonus that it does not\ncost an extra process at runtime. I'd probably use a sort if we expected\nthe list to be long and complicated, since it makes life easier on a\nfuture developer. But since there are only 2 lines, I don't think it's a\nbig deal either way (or even just leaving it as-is without a comment is\nprobably OK).\n\n> I thought there might be a test function to sort the output,\n> but I was (incorrectly) thinking of check_access_log() which\n> Gábor added in e8b3b2e275 (\"t/lib-httpd: avoid occasional\n> failures when checking access.log\", 2018-07-12).\n> \n> Perhaps it would be useful to have a test_cmp_sorted() to do\n> the simple dance of sorting the actual & expected.  I\n> haven't looked through the tests to see how often such a\n> function might be useful.\n\nI suspect it would occasionally be useful, but I don't recall it coming\nup all that often.\n\n-Peff\n"},{"id":"357882","messageId":"xmqqsh2gosdb.fsf@gitster-ct.c.googlers.com","threadId":"49302","inReplyTo":"20180907232205.31328-1-tmz@pobox.com","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-11T17:29:04Z","receivedAt":"2018-09-11T17:29:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Todd Zullinger <tmz@pobox.com> writes:\n\n> With curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output\n> used in the 'cookies stored in http.cookiefile when http.savecookies\n> set' test before comparing it to the expected cookies.\n>\n> ¹ https://github.com/curl/curl/commit/e2ef8d6fa (\"cookies: support\n>   creation-time attribute for cookies\", 2018-08-28)\n>\n> Signed-off-by: Todd Zullinger <tmz@pobox.com>\n> ---\n> [Resending with the list in Cc; sorry for spamming you,\n> Junio, Jeff, and Gábor.]\n> ...\n> 7ae89caac6c721f16555e981eaeed64abc165c5d\trefs/heads/master\n> 263207bb5fbfbefbdf1c9c3fa4ae5d9663323217\trefs/namespaces/ns/refs/heads/master\n> ++ tail -3 cookies.txt\n> ++ test_cmp expect_cookies.txt cookies_tail.txt\n> ++ diff -u expect_cookies.txt cookies_tail.txt\n> --- expect_cookies.txt\t2018-09-07 07:29:05.231532462 +0000\n> +++ cookies_tail.txt\t2018-09-07 07:29:05.306532366 +0000\n\nHave you tried to apply this e-mail yourself before spamming the\nlist ;-)?\n\nA good way to add supporting material that may be confusing to the\npatch text itself is to indent them by one place with SP.\n\nI'll manage anyway; thanks for a patch.\n\n> @@ -1,3 +1,3 @@\n>\n> -127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n>  127.0.0.1\tFALSE\t/smart_cookies/repo.git/info/\tFALSE\t0\tname\tvalue\n> +127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n> error: last command exited with $?=1\n> not ok 22 - cookies stored in http.cookiefile when http.savecookies set\n>\n>  t/t5551-http-fetch-smart.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\n> index 771f36f9ff..538656bfef 100755\n> --- a/t/t5551-http-fetch-smart.sh\n> +++ b/t/t5551-http-fetch-smart.sh\n> @@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n>  \tgit config http.cookiefile cookies.txt &&\n>  \tgit config http.savecookies true &&\n>  \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n> -\ttail -3 cookies.txt >cookies_tail.txt &&\n> +\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n>  \ttest_cmp expect_cookies.txt cookies_tail.txt\n>  '\n"},{"id":"358349","messageId":"xmqqd0tb6bn0.fsf@gitster-ct.c.googlers.com","threadId":"49302","inReplyTo":"20180908161712.GA9016@sigill.intra.peff.net","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-17T21:45:55Z","receivedAt":"2018-09-17T21:46:01Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Yes, I think sorting the expect file would work fine. I'm OK with that,\n> or just leaving a comment. The comment has the bonus that it does not\n> cost an extra process at runtime. I'd probably use a sort if we expected\n> the list to be long and complicated, since it makes life easier on a\n> future developer. But since there are only 2 lines, I don't think it's a\n> big deal either way (or even just leaving it as-is without a comment is\n> probably OK).\n\nLet's have \"| sort\" if only for its documentation value.  That way\nwe do not have to remember the list must be sorted.\n\nHere is what I'll merge to 'next'.\n\n-- >8 --\nFrom: Todd Zullinger <tmz@pobox.com>\nDate: Fri, 7 Sep 2018 19:22:05 -0400\nSubject: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing\nMIME-Version: 1.0\nContent-Type: text/plain; charset=UTF-8\nContent-Transfer-Encoding: 8bit\n\nWith curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output\nused in the 'cookies stored in http.cookiefile when http.savecookies\nset' test before comparing it to the expected cookies.\n\n¹ https://github.com/curl/curl/commit/e2ef8d6fa (\"cookies: support\n  creation-time attribute for cookies\", 2018-08-28)\n\n[jc: Also use a part of the patch by Thomas Gummerer that sorts the\nexpected output, which makes it easier to maintain.]\n\nSigned-off-by: Todd Zullinger <tmz@pobox.com>\nHelped-by: Thomas Gummerer <t.gummerer@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5551-http-fetch-smart.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\nindex 771f36f9ff..d13b993201 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -206,7 +206,7 @@ test_expect_success 'dumb clone via http-backend respects namespace' '\n cat >cookies.txt <<EOF\n 127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n EOF\n-cat >expect_cookies.txt <<EOF\n+cat <<EOF | sort >expect_cookies.txt\n \n 127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n 127.0.0.1\tFALSE\t/smart_cookies/repo.git/info/\tFALSE\t0\tname\tvalue\n@@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n \tgit config http.cookiefile cookies.txt &&\n \tgit config http.savecookies true &&\n \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n-\ttail -3 cookies.txt >cookies_tail.txt &&\n+\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n \ttest_cmp expect_cookies.txt cookies_tail.txt\n '\n \n-- \n2.19.0\n\n"},{"id":"358367","messageId":"20180917221603.GA3621@sigill.intra.peff.net","threadId":"49302","inReplyTo":"xmqqd0tb6bn0.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2018-09-17T22:25:39Z","receivedAt":"2018-09-17T22:25:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Sep 17, 2018 at 02:45:55PM -0700, Junio C Hamano wrote:\n\n> Jeff King <peff@peff.net> writes:\n> \n> > Yes, I think sorting the expect file would work fine. I'm OK with that,\n> > or just leaving a comment. The comment has the bonus that it does not\n> > cost an extra process at runtime. I'd probably use a sort if we expected\n> > the list to be long and complicated, since it makes life easier on a\n> > future developer. But since there are only 2 lines, I don't think it's a\n> > big deal either way (or even just leaving it as-is without a comment is\n> > probably OK).\n> \n> Let's have \"| sort\" if only for its documentation value.  That way\n> we do not have to remember the list must be sorted.\n\nOK, though...\n\n> diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\n> index 771f36f9ff..d13b993201 100755\n> --- a/t/t5551-http-fetch-smart.sh\n> +++ b/t/t5551-http-fetch-smart.sh\n> @@ -206,7 +206,7 @@ test_expect_success 'dumb clone via http-backend respects namespace' '\n>  cat >cookies.txt <<EOF\n>  127.0.0.1\tFALSE\t/smart_cookies/\tFALSE\t0\tothername\tothervalue\n>  EOF\n> -cat >expect_cookies.txt <<EOF\n> +cat <<EOF | sort >expect_cookies.txt\n\nThis can be spelled:\n\n  sort >expect_cookies.txt <<EOF\n\ncan't it? Then we do not even incur the extra process. :)\n\n-Peff\n"},{"id":"358375","messageId":"xmqqy3bz4lik.fsf@gitster-ct.c.googlers.com","threadId":"49302","inReplyTo":"20180917221603.GA3621@sigill.intra.peff.net","subject":"Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-09-18T01:55:31Z","receivedAt":"2018-09-18T01:55:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n>> -cat >expect_cookies.txt <<EOF\n>> +cat <<EOF | sort >expect_cookies.txt\n>\n> This can be spelled:\n>\n>   sort >expect_cookies.txt <<EOF\n>\n> can't it? Then we do not even incur the extra process. :)\n\nYeah, true.  Running cat only to feed a pipe with contents of a\nsingle file or the here-doc is an anti-pattern.\n"}]}