git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pranit Bauva <pranit.bauva@gmail.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: Stefan Beller <sbeller@google.com>,
	"git@vger.kernel.org" <git@vger.kernel.org>,
	Paul Tan <pyokagan@gmail.com>
Subject: Re: [PATCH v2] am: add am.signoff add config variable
Date: Thu, 29 Dec 2016 13:29:33 +0530	[thread overview]
Message-ID: <CAFZEwPOPMrCXTc+SMhjGSnPKLmefcde4MgJsz7n5rBApACZOug@mail.gmail.com> (raw)
In-Reply-To: <20161228191928.GH3441@thinpad.lan.raisama.net>

Hey Eduardo,

On Thu, Dec 29, 2016 at 12:49 AM, Eduardo Habkost <ehabkost@redhat.com> wrote:
>> test_expect_success '--no-signoff overrides am.signoff' '
>>       rm -fr .git/rebase-apply &&
>>       git reset --hard first &&
>>       test_config am.signoff true &&
>>       git am --no-signoff <patch2 &&
>>       printf "%s\n" "$signoff" >expected &&
>>       git cat-file commit HEAD^ | grep "Signed-off-by:" >actual &&
>>       test_cmp expected actual &&
>>       git cat-file commit HEAD | grep "Signed-off-by:" >actual &&
>>       test_must_be_empty actual
>> '
>>
>> The test fails because the second "grep" command returns a
>> non-zero exit code. Any suggestions to avoid that problem in a
>> more idiomatic way?
>
> I just found out that "test_must_fail grep ..." is a common
> idiom, so what about:

Is there any particular reason to use "grep" instead of "test_cmp"? To
check for non-zero error code, you can always use "! test_cmp".

Regards,
Pranit Bauva

  parent reply	other threads:[~2016-12-29  7:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-28 18:35 [PATCH v2] am: add am.signoff add config variable Eduardo Habkost
2016-12-28 18:51 ` Stefan Beller
2016-12-28 19:11   ` Eduardo Habkost
2016-12-28 19:19     ` Eduardo Habkost
2016-12-28 19:24       ` Stefan Beller
2016-12-29  7:59       ` Pranit Bauva [this message]
2016-12-29 15:37         ` Eduardo Habkost
2016-12-28 19:07 ` Andreas Schwab
2016-12-28 19:12   ` Eduardo Habkost

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=CAFZEwPOPMrCXTc+SMhjGSnPKLmefcde4MgJsz7n5rBApACZOug@mail.gmail.com \
    --to=pranit.bauva@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=git@vger.kernel.org \
    --cc=pyokagan@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).