git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] commit: add commit.signoff config option

From
Remi Galan Alfonso <remi.galan-alfonso@ensimag.grenoble-inp.fr>
Date
Jun 25, 2015, 08:32 UTC
Message-ID
<1228200928.789773.1435221179871.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<20150625082059.GA9937@alex-host>
Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com> writes:
Show 22 quoted lines
> +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
Previous: Alexander KuleshovNext: Caio Marcelo de Oliveira Filho
Message 3 of 4 in “commit: add commit.signoff config option”
  1. commit: add commit.signoff config optioncmarcelo@gmail.com, Jun 25, 2015
  2. Alexander KuleshovJun 25, 2015
  3. Remi Galan AlfonsoJun 25, 2015
  4. Caio Marcelo de Oliveira FilhoJun 25, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.