From: Junio C Hamano <gitster@pobox.com>
To: Prarit Bhargava <prarit@redhat.com>
Cc: git@vger.kernel.org, sandals@crustytoothpaste.net, peff@peff.net,
szeder.dev@gmail.com
Subject: Re: [PATCH v3 2/3] t4203: Use test-lib.sh definitions
Date: Fri, 25 Oct 2019 15:18:25 +0900 [thread overview]
Message-ID: <xmqq4kzxcpqm.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: 20191024233617.18716-3-prarit@redhat.com
Prarit Bhargava <prarit@redhat.com> writes:
> Use name and email definitions from test-lib.sh.
>
> Signed-off-by: Prarit Bhargava <prarit@redhat.com>
> ---
> t/t4203-mailmap.sh | 94 +++++++++++++++++++++++-----------------------
> 1 file changed, 47 insertions(+), 47 deletions(-)
>
> diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
> index 918ada69eb96..e8f9c0f5bc8c 100755
> --- a/t/t4203-mailmap.sh
> +++ b/t/t4203-mailmap.sh
> @@ -13,8 +13,8 @@ fuzz_blame () {
> }
>
> test_expect_success setup '
> - cat >contacts <<-\EOF &&
> - A U Thor <author@example.com>
> + cat >contacts <<- EOF &&
> + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
> nick1 <bugs@company.xx>
> EOF
>
> @@ -33,19 +33,19 @@ test_expect_success 'check-mailmap no arguments' '
> '
>
> test_expect_success 'check-mailmap arguments' '
> - cat >expect <<-\EOF &&
> - A U Thor <author@example.com>
> + cat >expect <<- EOF &&
> + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
> nick1 <bugs@company.xx>
> EOF
> git check-mailmap \
> - "A U Thor <author@example.com>" \
> + "$GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" \
> "nick1 <bugs@company.xx>" >actual &&
> test_cmp expect actual
> '
>
> test_expect_success 'check-mailmap --stdin' '
> - cat >expect <<-\EOF &&
> - A U Thor <author@example.com>
> + cat >expect <<- EOF &&
> + $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>
> nick1 <bugs@company.xx>
> EOF
> git check-mailmap --stdin <contacts >actual &&
Strictly speaking, the above is different from the ones that appear
in the rest of this patch and the ones in step 1/3.
The reason why you need to expect "author@example.com" in the output
of check-mailmap is only because the same hardcoded string is used
in the setup step of this test.
The remainder of this file and step 1/3 are quite different and are
all good changes. The commit the data comes from gets created with
the value that happens to be set to GIT_AUTHOR_NAME in test-lib---if
the assigned value changes over there, the tests that expect
hardcoded "author@example.com" would break, and that makes the step
1/3 and the remainder of this patch good changes.
In any case, I think all of 1/3 and 2/3 taken together are good
preparatory steps for 3/3.
Thanks, will queue.
next prev parent reply other threads:[~2019-10-25 6:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 23:36 [PATCH v3 0/3] Implement option to output local-part of email addresses Prarit Bhargava
2019-10-24 23:36 ` [PATCH v3 1/3] t6006: Use test-lib.sh definitions Prarit Bhargava
2019-10-25 6:05 ` Junio C Hamano
2019-10-24 23:36 ` [PATCH v3 2/3] t4203: " Prarit Bhargava
2019-10-25 6:18 ` Junio C Hamano [this message]
2019-10-24 23:36 ` [PATCH v3 3/3] pretty: add "%aL"|"%al|%cL|%cl" option to output local-part of email addresses Prarit Bhargava
2019-10-25 5:51 ` Junio C Hamano
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=xmqq4kzxcpqm.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=prarit@redhat.com \
--cc=sandals@crustytoothpaste.net \
--cc=szeder.dev@gmail.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).