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

Re: [PATCH 6/5] t9001: check send-email behavior with implicit sender

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 28, 2012, 18:55 UTC
Message-ID
<7vk3t5v9q1.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20121128184229.GA3993@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 66 quoted lines
> On Wed, Nov 28, 2012 at 01:25:35PM -0500, Jeff King wrote:
>
>> Here are the cleanups and refactorings split out from my
>> jk/send-email-sender-prompt series. They can go right on master and are
>> independent of Felipe's fc/send-email-no-sender-prompt topic.
>> [...]
>> Dropped were:
>> [...]
>>   - send-email prompting change; obsoleted by Felipe's patch
>
> Here is one more patch pulling out the extra tests from my final commit.
> It needs to go on top of the merge of Felipe's series and the one I just
> sent. The former because of the new prompting behavior, and the latter
> because of the AUTOIDENT prerequisites.
>
> If it's simpler, my whole series can just go on top of Felipe's patch
> (or vice versa).
>
> -- >8 --
> Subject: [PATCH] t9001: check send-email behavior with implicit sender
>
> We allow send-email to use an implicitly-defined identity
> for the sender (because there is still a confirmation step),
> but we abort when we cannot generate such an identity. Let's
> make sure that we test this.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
>  t/t9001-send-email.sh | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/t/t9001-send-email.sh b/t/t9001-send-email.sh
> index c5d66cf..27edfa8 100755
> --- a/t/t9001-send-email.sh
> +++ b/t/t9001-send-email.sh
> @@ -201,6 +201,34 @@ test_expect_success $PREREQ 'Prompting works' '
>  		grep "^To: to@example.com\$" msgtxt1
>  '
>  
> +test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
> +       clean_fake_sendmail &&
> +       (sane_unset GIT_AUTHOR_NAME &&
> +	sane_unset GIT_AUTHOR_EMAIL &&
> +	sane_unset GIT_COMMITTER_NAME &&
> +	sane_unset GIT_COMMITTER_EMAIL &&
> +	GIT_SEND_EMAIL_NOTTY=1 git send-email \
> +		--smtp-server="$(pwd)/fake.sendmail" \
> +		--to=to@example.com \
> +		$patches \
> +		</dev/null 2>errors
> +       )
> +'
> +
> +test_expect_success $PREREQ,!AUTOIDENT 'broken implicit ident aborts send-email' '
> +       clean_fake_sendmail &&
> +       (sane_unset GIT_AUTHOR_NAME &&
> +	sane_unset GIT_AUTHOR_EMAIL &&
> +	sane_unset GIT_COMMITTER_NAME &&
> +	sane_unset GIT_COMMITTER_EMAIL &&
> +	GIT_SEND_EMAIL_NOTTY=1 && export GIT_SEND_EMAIL_NOTTY &&
> +	test_must_fail git send-email \
> +		--smtp-server="$(pwd)/fake.sendmail" \
> +		$patches </dev/null 2>errors &&
> +	test_i18ngrep "tell me who you are" errors
> +       )
> +'

The difference between these two tests should solely come from AUTOIDENT and nothing else, so it would be better to see their command line arguments to match; the former is with --to and the latter is without in this patch but I do not think you meant them to differ that way.

>  test_expect_success $PREREQ 'tocmd works' '
>  	clean_fake_sendmail &&
>  	cp $patches tocmd.patch &&
Previous: Jeff KingNext: Jeff King
Message 8 of 12 in “jk/send-email-sender-prompt loose ends”
  1. 0/5 jk/send-email-sender-prompt loose endsJeff King, Nov 28, 2012
  2. 1/5 test-lib: allow negation of prerequisitesJeff King, Nov 28, 2012
  3. 2/5 t7502: factor out autoident prerequisiteJeff King, Nov 28, 2012
  4. 3/5 ident: make user_ident_explicitly_given staticJeff King, Nov 28, 2012
  5. 4/5 ident: keep separate "explicit" flags for author and committerJeff King, Nov 28, 2012
  6. 5/5 t: add tests for "git var"Jeff King, Nov 28, 2012
  7. 6/5 t9001: check send-email behavior with implicit senderJeff King, Nov 28, 2012
  8. Junio C HamanoNov 28, 2012
  9. Jeff KingNov 28, 2012
  10. Jeff KingNov 28, 2012
  11. Junio C HamanoNov 28, 2012
  12. Felipe ContrerasNov 28, 2012

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.