Re: [PATCH v4 1/6] t9001: non order-sensitive file comparison
From: Junio C Hamano <hidden>
Date: 2016-06-16 02:19:48
Samuel GROOT [off-list ref] writes:
quoted hunk
@@ -117,7 +124,7 @@ test_expect_success $PREREQ 'setup expect' ' ' test_expect_success $PREREQ 'Verify commandline' ' - test_cmp expected commandline1 + test_cmp_noorder expected commandline1 ' test_expect_success $PREREQ 'Send patches with --envelope-sender=auto' '
I think this comment applies to all the other hunk in this patch (I
didn't check very carefully though), but this is trying to see if
the command line arguments that drives send-email are like this (one
arg per line, enclosed in !! pairs for clarity):
!patch@example.com!
!-i!
!nobody@example.com!
!author@example.com!
!one@example.com!
!two@example.com!
when these addresses are given from the command line:
git send-email \
--envelope-sender="Patch Contributor [off-list ref]" \
--suppress-cc=sob \
--from="Example [off-list ref]" \
--to=nobody@example.com \
--smtp-server="$(pwd)/fake.sendmail" $patches 2>errors
that creates something like
$TRASH_DIRECTORY/fake.sendmail -f patch@example.com -i \
nobody@example.com author@example.com one@example.com two@example.com
(all on a single line).
The earliest address patch@example.com and later addresses have
quite different meaning (the first one is meant to be the envelope
sender address, and does not name a recipient). While I think it is
a good idea to tell the test that the order of recipient addresses
given to the sendmail command (i.e. nobody, author, one and two)
does not matter by comparing sorted list of addresses, sorting the
whole argument list and comparing is making the test _too_ loose.
Don't you want to catch a potential bug that adds the envelope
sender address to the list of recipients by mistake, for example?