From: Eric Sunshine Date: Fri, 22 May 2015 03:59:38 GMT Subject: Re: [PATCH v2] send-email: Add simple email aliases format Message-ID: In-Reply-To: On Thu, May 21, 2015 at 11:19 PM, Allen Hubbe wrote: > On May 21, 2015 9:05 PM, "Eric Sunshine" wrote: >> On Thu, May 21, 2015 at 8:16 PM, Allen Hubbe wrote: >> > +test_expect_success $PREREQ 'sendemail.aliasfiletype=simple' ' >> > + clean_fake_sendmail && rm -fr outdir && >> > + git format-patch -1 -o outdir && >> > + { >> > + echo "alice: Alice W Land " >> > + echo "bob: Robert Bobbyton " >> > + echo "chloe: chloe@example.com" >> > + echo "abgroup: alice, bob" >> > + echo "bcgrp: bob, chloe, Other " >> > + } >~/.tmp-email-aliases && >> >> A here-doc would be easier to maintain and read: >> >> cat >~/.tmp-email-aliases <<-\EOF && >> alice: Alice W Land >> bob: Robert Bobbyton >> ... >> EOF > > A here-doc does not flow nicely in an indented block. Each line in > the here-doc will also contain any indentation which may appear to the > reader to be part of the test case. Alternatively, the here-doc could > be indented differently than the surrounding test case (all the way to > the left column), but that also has a negative impact for readability. > Finally, the EOF marker can not be indented. That's true if you use < With echo "string", exactly "string" is output to the line. The > operation is obvious to the reader. The test case can use sane > indentation, and the resulting output will be exactly what what it > would appear to be in the test case. Same with <<-\EOF; plus <<-\EOF content is more readable since it's not polluted with 'echo' noise. > Especially for something like a test case where there should be > absolutely no confusion as to exactly what is the input to the test, > clarity matters. Any operation where the result is not immediately > obvious to the reader, does not belong here. Therefore, I will keep > the lines in the test case as echo "string".