public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Jeff King <peff@peff•net>
Cc: Michael Blume <blume.mike@gmail•com>,
	Git List <git@vger•kernel.org>,
	Luis Henriques <henrix@camandro•org>
Subject: Re: no-xmailer tests fail under Mac OS
Date: Thu, 11 Dec 2014 14:11:04 -0800	[thread overview]
Message-ID: <xmqq1to5et1j.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <20141206071234.GA6850@peff.net> (Jeff King's message of "Sat, 6 Dec 2014 02:12:34 -0500")

Jeff King <peff@peff•net> writes:

> On Fri, Dec 05, 2014 at 11:07:37PM -0800, Michael Blume wrote:
>
>> > Ah, right, we might be looking for 0 sometimes. The right way to do it
>> > without destroying the &&-chaining is:
>> >
>> >   { grep ^X-Mailer: out || true } &&
>> >   test_line_count = $expected mailer
>> 
>> Hmm, it doesn't look like that helper is &&-chained though? So it
>> seems like we could just do without the &&
>
> You're right, but that is IMHO a bug. We would not notice if send-email
> or format-patch barfed, and we are expecting to find no X-Mailer (we
> wouldn't, but for the wrong reason).

Let me patch this up further by amending the SQUASH??? at the tip.

 t/t9001-send-email.sh | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
index bb573ef..7826aa8 100755
--- a/t/t9001-send-email.sh
+++ b/t/t9001-send-email.sh
@@ -1408,18 +1408,17 @@ test_expect_success $PREREQ 'sendemail.aliasfile=~/.mailrc' '
 '
 
 do_xmailer_test() {
-	expected=$1
-	params=$2
-	git format-patch -1
+	expected=$1 params=$2 &&
+	git format-patch -1 &&
 	git send-email \
 		--from="Example <nobody@example•com>" \
 		--to=someone@example•com \
 		--smtp-server="$(pwd)/fake.sendmail" \
 		$params \
 		0001-*.patch \
-		2>errors >out
-	test "z$(grep ^X-Mailer: out | wc -l)" = "z$expected"
-	return $?
+		2>errors >out &&
+	{ grep '^X-Mailer:' out || :; } >mailer &&
+	test_line_count = $expected mailer
 }
 
 test_expect_success $PREREQ '--[no-]xmailer without any configuration' '

  reply	other threads:[~2014-12-11 22:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06  2:05 no-xmailer tests fail under Mac OS Michael Blume
2014-12-06  5:34 ` Jeff King
2014-12-06  6:27   ` Michael Blume
2014-12-06  6:32     ` Jeff King
     [not found]       ` <CAO2U3QgDMpKwqsjzPNECpJw4z+WbboX5ug7Shu5v5ZCuPsKuGQ@mail.gmail.com>
2014-12-06  7:12         ` Jeff King
2014-12-11 22:11           ` Junio C Hamano [this message]
2014-12-11 22:13             ` Jeff King
2014-12-11 22:35               ` Luis Henriques
2014-12-09 19:45 ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq1to5et1j.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=blume.mike@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=henrix@camandro$(echo .)org \
    --cc=peff@peff$(echo .)net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox