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

Re: [PATCH] t5551: compare sorted cookies files

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Sep 17, 2018, 21:19 UTC
Message-ID
<20180917211926.GI140909@aiede.svl.corp.google.com>
In-Reply-To
<20180917211026.GA4095@hank.intra.tgummerer.com>
Thomas Gummerer wrote:
> On 09/17, Junio C Hamano wrote:
Show 10 quoted lines
>>                                                         The other
>> effort implicitly depends on the expected output is kept sorted, but
>> this one is more explicit---I tend to prefer this approach as tools
>> and automation is easier to maintain than having to remember that
>> the source must be sorted.
>
> I'm happy going with either patch, but if we want to go with mine, I'd
> like to make sure Todd is credited appropriately, as he sent a very
> similar patch first.  Not sure what the appropriate way here is
> though?
Thanks for asking.  Credit is a subject that is dear to my heart.
You can for example use
Reported-by: Todd Zullinger <tmz@pobox.com>

to credit him for the patch and analysis that appears to have helped with reviews (and to signal that this fixes the bug he reported).

[...]
Show 8 quoted lines
>>> --- 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
Should this be
	sort >expect_cookies.txt <<\EOF

? That is simpler since it avoids a pipe and means the reader doesn't have to look out for shell metacharacters like $ inside the text.

Bonus points if this kind of setup moves to inside the test (using <<-\EOF), which can make the test script easier to read.

Thanks and hope that helps, Jonathan

Previous: Thomas GummererNext: Thomas Gummerer
Message 4 of 7 in “t5551: compare sorted cookies files”
  1. t5551: compare sorted cookies filesThomas Gummerer, Sep 17, 2018
  2. Junio C HamanoSep 17, 2018
  3. Thomas GummererSep 17, 2018
  4. Jonathan NiederSep 17, 2018
  5. 0/2 t5551: compare sorted cookies filesThomas Gummerer, Sep 17, 2018
  6. 1/2 t5551: move setup code inside test_expect blocksThomas Gummerer, Sep 17, 2018
  7. 2/2 t5551: compare sorted cookies filesThomas Gummerer, Sep 17, 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.