git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Remi Galan Alfonso <remi.galan-alfonso@ensimag.grenoble-inp.fr>
To: cmarcelo@gmail.com
Cc: git@vger.kernel.org
Subject: Re: [PATCH] commit: add commit.signoff config option
Date: Thu, 25 Jun 2015 10:32:59 +0200 (CEST)	[thread overview]
Message-ID: <1228200928.789773.1435221179871.JavaMail.zimbra@ensimag.grenoble-inp.fr> (raw)
In-Reply-To: <20150625082059.GA9937@alex-host>

Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com> writes:
> +test_expect_success 'commit.signoff config option' '
> +        git config commit.signoff true &&
> +        echo "yet another content *narf*" >> foo &&
> +        echo "zort" | git commit -F - foo &&
> +        git cat-file commit HEAD | sed "1,/^\$/d" > output &&
> +        git config --unset commit.signoff &&
> +        test_cmp expect output
> +'
> +
> +cat > expect <<EOF
> +no signed off by here
> +EOF
> +
> +test_expect_success '--no-signoff' '
> +        git config commit.signoff true &&
> +        echo "yet another content *narf*" >> foo &&
> +        echo "no signed off by here" | git commit --no-signoff -F - foo &&
> +        git cat-file commit HEAD | sed "1,/^\$/d" > output &&
> +        git config --unset commit.signoff &&
> +        test_cmp expect output
> +'
> +

In both tests, you should probably use 'test_config' instead of 'git
config [...] git config --unset', it takes care of it for you (also
should prevent the case where the config is not unset when your test
fails in the middle).

For example, the first test would be:
test_expect_success 'commit.signoff config option' '
	test_config commit.signoff true &&
	echo "yet another content *narf*" >> foo &&
	echo "zort" | git commit -F - foo &&
	git cat-file commit HEAD | sed "1,/^\$/d" > output &&
	test_cmp expect output
'

Rémi

  reply	other threads:[~2015-06-25  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25  7:30 [PATCH] commit: add commit.signoff config option cmarcelo
2015-06-25  8:21 ` Alexander Kuleshov
2015-06-25  8:32   ` Remi Galan Alfonso [this message]
2015-06-25 14:57     ` Caio Marcelo de Oliveira Filho
2015-06-25  7:32 Caio Marcelo de Oliveira Filho
2015-06-25  8:43 ` Christian Couder
2015-06-25 14:55   ` Caio Marcelo de Oliveira Filho

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=1228200928.789773.1435221179871.JavaMail.zimbra@ensimag.grenoble-inp.fr \
    --to=remi.galan-alfonso@ensimag.grenoble-inp.fr \
    --cc=cmarcelo@gmail.com \
    --cc=git@vger.kernel.org \
    /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).