git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] t5551-http-fetch-smart.sh: sort cookies before comparing

From
Jeff King <peff@peff.net>
Date
Sep 17, 2018, 22:25 UTC
Message-ID
<20180917221603.GA3621@sigill.intra.peff.net>
In-Reply-To
<xmqqd0tb6bn0.fsf@gitster-ct.c.googlers.com>
On Mon, Sep 17, 2018 at 02:45:55PM -0700, Junio C Hamano wrote:
Show 12 quoted lines
> 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.
OK, though...
Show 10 quoted lines
> 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
This can be spelled:
  sort >expect_cookies.txt <<EOF
can't it? Then we do not even incur the extra process. :)
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “t5551-http-fetch-smart.sh: sort cookies before comparing”
  1. t5551-http-fetch-smart.sh: sort cookies before comparingTodd Zullinger, Sep 7, 2018
  2. Jeff KingSep 7, 2018
  3. Todd ZullingerSep 8, 2018
  4. Jeff KingSep 8, 2018
  5. Junio C HamanoSep 17, 2018
  6. Jeff KingSep 17, 2018
  7. Junio C HamanoSep 18, 2018
  8. Junio C HamanoSep 11, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.