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