From: Jeff King <peff@peff.net>
To: Todd Zullinger <tmz@pobox.com>
Cc: "Junio C Hamano" <gitster@pobox.com>,
"SZEDER Gábor" <szeder.dev@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing
Date: Sat, 8 Sep 2018 12:17:12 -0400 [thread overview]
Message-ID: <20180908161712.GA9016@sigill.intra.peff.net> (raw)
In-Reply-To: <20180908032841.GK7192@zaya.teonanacatl.net>
On Fri, Sep 07, 2018 at 11:28:41PM -0400, Todd Zullinger wrote:
> > So this fix looks fine. It might be worth a comment above the creation
> > of expect_cookies.txt to mention it must be in sorted order (of course
> > anybody modifying it would see a test failure).
>
> I thought about running the expect_cookies.txt file through
> sort as well. That would ensure that both files were using
> the same sorting. Whether that's needed on any platform
> now, I don't know. Maybe that would be a useful way to
> protect against future edits to the expect_cookies.txt file
> catching the editor?
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).
> I thought there might be a test function to sort the output,
> but I was (incorrectly) thinking of check_access_log() which
> Gábor added in e8b3b2e275 ("t/lib-httpd: avoid occasional
> failures when checking access.log", 2018-07-12).
>
> Perhaps it would be useful to have a test_cmp_sorted() to do
> the simple dance of sorting the actual & expected. I
> haven't looked through the tests to see how often such a
> function might be useful.
I suspect it would occasionally be useful, but I don't recall it coming
up all that often.
-Peff
next prev parent reply other threads:[~2018-09-08 16:17 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 [this message]
2018-09-17 21:45 ` Junio C Hamano
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180908161712.GA9016@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=szeder.dev@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.
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 NNTP newsgroup(s).