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

Re: [PATCH v2 1/3] check-mailmap: accept "user@host" contacts

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Aug 21, 2024, 18:27 UTC
Message-ID
<CAPig+cRhEJP6-ZX3X9SYrGM335-XTp8V=D9Yc7xkJQAh-g8xRw@mail.gmail.com>
In-Reply-To
<mjlmmgwczact5ryprmorqztip2ynpcu5gpbulfabnoul2ubnr6@pfaxe7j4xo3h>
On Wed, Aug 21, 2024 at 1:50 PM Josh Steadmon <steadmon@google.com> wrote:
Show 15 quoted lines
> On 2024.08.19 17:07, Jacob Keller wrote:
> > diff --git a/t/t4203-mailmap.sh b/t/t4203-mailmap.sh
> > @@ -73,11 +73,40 @@ test_expect_success 'check-mailmap --stdin arguments: mapping' '
> >  test_expect_success 'check-mailmap bogus contact' '
> > -     test_must_fail git check-mailmap bogus
> > +     cat >expect <<-EOF &&
> > +     <bogus>
> > +     EOF
> > +     git check-mailmap bogus >actual &&
> > +     test_cmp expect actual
> >  '
>
> I think I'd just remove this test case altogether, IIUC it' doesn't
> provide any additional value vs. the "check-mailmap simple address: no
> mapping" test below.
I had the same thought upon reading this.
Show 14 quoted lines
> >  test_expect_success 'check-mailmap bogus contact --stdin' '
> > -     test_must_fail git check-mailmap --stdin bogus </dev/null
> > +     cat >expect <<-EOF &&
> > +     <bogus>
> > +     EOF
> > +     cat >stdin <<-EOF &&
> > +     bogus
> > +     EOF
> > +     git check-mailmap --stdin <stdin >actual &&
> > +     test_cmp expect actual
> > +'
>
> Similarly, I might change this to use a real address instead of "bogus",
> as we're no longer checking for invalid input.

Ditto for this change, but even more so because this is a fairly significant semantic change. In particular, the documented and intended behavior of the command when --stdin is specified is that it will consume email addresses from *both* the command-line and from standard input, and I think the point of the original test was to verify that it still correctly recognized a bogus email address specified as an argument even when --stdin is requested. Given that understanding (assuming it's correct), then the original test was already perhaps somewhat iffy anyhow, but after this change, it is even less meaningful.

Previous: Jacob KellerNext: Jacob Keller
Message 6 of 10 in “send-email: add --mailmap support”
  1. 0/3 send-email: add --mailmap supportJacob Keller, Aug 20, 2024
  2. 1/3 check-mailmap: accept "user@host" contactsJacob Keller, Aug 20, 2024
  3. Josh SteadmonAug 21, 2024
  4. Junio C HamanoAug 21, 2024
  5. Jacob KellerAug 21, 2024
  6. Eric SunshineAug 21, 2024
  7. Jacob KellerAug 21, 2024
  8. 2/3 check-mailmap: add options for additional mailmap sourcesJacob Keller, Aug 20, 2024
  9. 3/3 send-email: add mailmap support via sendemail.mailmap and --mailmapJacob Keller, Aug 20, 2024
  10. Josh SteadmonAug 21, 2024

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.