git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: "Todd Zullinger" <tmz@pobox.com>,
	"SZEDER Gábor" <szeder.dev@gmail.com>,
	git@vger.kernel.org, "Thomas Gummerer" <t.gummerer@gmail.com>,
	"Jonathan Nieder" <jrnieder@gmail.com>
Subject: Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing
Date: Mon, 17 Sep 2018 14:45:55 -0700	[thread overview]
Message-ID: <xmqqd0tb6bn0.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180908161712.GA9016@sigill.intra.peff.net> (Jeff King's message of "Sat, 8 Sep 2018 12:17:12 -0400")

Jeff King <peff@peff.net> writes:

> Yes, I think sorting the expect file would work fine. I'm OK with that,
> or just leaving a comment. The comment has the bonus that it does not
> cost an extra process at runtime. I'd probably use a sort if we expected
> the list to be long and complicated, since it makes life easier on a
> future developer. But since there are only 2 lines, I don't think it's a
> big deal either way (or even just leaving it as-is without a comment is
> probably OK).

Let's have "| sort" if only for its documentation value.  That way
we do not have to remember the list must be sorted.

Here is what I'll merge to 'next'.

-- >8 --
From: Todd Zullinger <tmz@pobox.com>
Date: Fri, 7 Sep 2018 19:22:05 -0400
Subject: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

With curl-7.61.1 cookies are sorted by creation-time¹.  Sort the output
used in the 'cookies stored in http.cookiefile when http.savecookies
set' test before comparing it to the expected cookies.

¹ https://github.com/curl/curl/commit/e2ef8d6fa ("cookies: support
  creation-time attribute for cookies", 2018-08-28)

[jc: Also use a part of the patch by Thomas Gummerer that sorts the
expected output, which makes it easier to maintain.]

Signed-off-by: Todd Zullinger <tmz@pobox.com>
Helped-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/t5551-http-fetch-smart.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh
index 771f36f9ff..d13b993201 100755
--- a/t/t5551-http-fetch-smart.sh
+++ b/t/t5551-http-fetch-smart.sh
@@ -206,7 +206,7 @@ test_expect_success 'dumb clone via http-backend respects namespace' '
 cat >cookies.txt <<EOF
 127.0.0.1	FALSE	/smart_cookies/	FALSE	0	othername	othervalue
 EOF
-cat >expect_cookies.txt <<EOF
+cat <<EOF | sort >expect_cookies.txt
 
 127.0.0.1	FALSE	/smart_cookies/	FALSE	0	othername	othervalue
 127.0.0.1	FALSE	/smart_cookies/repo.git/info/	FALSE	0	name	value
@@ -215,7 +215,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set
 	git config http.cookiefile cookies.txt &&
 	git config http.savecookies true &&
 	git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
-	tail -3 cookies.txt >cookies_tail.txt &&
+	tail -3 cookies.txt | sort >cookies_tail.txt &&
 	test_cmp expect_cookies.txt cookies_tail.txt
 '
 
-- 
2.19.0


  reply	other threads:[~2018-09-17 21:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 23:22 [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing Todd Zullinger
2018-09-07 23:55 ` Jeff King
2018-09-08  3:28   ` Todd Zullinger
2018-09-08 16:17     ` Jeff King
2018-09-17 21:45       ` Junio C Hamano [this message]
2018-09-17 22:25         ` Jeff King
2018-09-18  1:55           ` Junio C Hamano
2018-09-11 17:29 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqd0tb6bn0.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=szeder.dev@gmail.com \
    --cc=t.gummerer@gmail.com \
    --cc=tmz@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).