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

Re: [PATCH v6] format-patch --signature-file <file>

From
Jeremiah Mahler <jmmahler@gmail.com>
Date
May 21, 2014, 22:12 UTC
Message-ID
<20140521221221.GC13956@hudson.localdomain>
In-Reply-To
<xmqqoayqoktp.fsf@gitster.dls.corp.google.com>
On Wed, May 21, 2014 at 02:58:42PM -0700, Junio C Hamano wrote:
> Jeremiah Mahler <jmmahler@gmail.com> writes:
> 
...
Show 30 quoted lines
> The problem is a "cat" you added outside test_expect_*; the recent
> push is to have as little executable outside them, especially the
> "set-up" code to prepare for the real tests.
> 
> i.e. we have been trying to write new tests (and convert old ones)
> like this:
> 
>         test_expect_success 'I test such and such ' '
>                 cat >input-for-test <<-\EOF &&
>                 here comes input
>                 EOF
>                 git command-to-be-tested <input-for-test >actual &&
>                 cat >expected <<-\EOF &&
>                 here comes expected output
>                 EOF
>                 test_cmp expected actual
>         '
> 
> not like this:
> 
>         cat >input-for-test <<-\EOF &&
>         here comes input
>         EOF
>         test_expect_success 'I test such and such ' '
>                 git command-to-be-tested <input-for-test >actual &&
>                 cat >expected <<-\EOF &&
>                 here comes expected output
>                 EOF
>                 test_cmp expected actual
>         '
Now I understand.
Below is one of the updated test cases.
test_expect_success 'format-patch --signature-file=mail-signature' '
	cat >mail-signature <<-\EOF
	Test User <test.email@kernel.org>
	http://git.kernel.org/cgit/git/git.git
	git.kernel.org/?p=git/git.git;a=summary
	EOF
	git format-patch --stdout --signature-file=mail-signature -1 >output &&
	check_patch output &&
	sed -n -e "/^-- $/,\$p" <output | sed -e "1d" | sed -e "\$d" >output2 &&
	test_cmp mail-signature output2
'
-- 
Jeremiah Mahler
jmmahler@gmail.com
http://github.com/jmahler
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 14 in “format-patch --signature-file <file>”
  1. format-patch --signature-file <file>Jeremiah Mahler, May 21, 2014
  2. format-patch --signature-file <file>Jeremiah Mahler, May 21, 2014
  3. Junio C HamanoMay 21, 2014
  4. Junio C HamanoMay 21, 2014
  5. Jeremiah MahlerMay 21, 2014
  6. Jeremiah MahlerMay 21, 2014
  7. Junio C HamanoMay 21, 2014
  8. Jeff KingMay 21, 2014
  9. Junio C HamanoMay 21, 2014
  10. Jeremiah MahlerMay 21, 2014
  11. Junio C HamanoMay 21, 2014
  12. Jeremiah MahlerMay 21, 2014
  13. Junio C HamanoMay 21, 2014
  14. Jeremiah MahlerMay 21, 2014

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.