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

Re: [PATCH v2 3/4] t4203: test mailmap functionality directly rather than indirectly

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 12, 2013, 02:37 UTC
Message-ID
<CAPig+cRtX=DHGK0D8zK2V9vZyS5-sGKmvEysLcG99De7RLGBOw@mail.gmail.com>
In-Reply-To
<20130712005517.GA8482@google.com>
On Thu, Jul 11, 2013 at 8:55 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 40 quoted lines
> Eric Sunshine wrote:
>> On Thu, Jul 11, 2013 at 3:07 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>>>> With the introduction of check-mailmap, it is now possible to check
>>>> .mailmap functionality directly rather than indirectly as a side-effect
>>>> of other commands (such as git-shortlog), therefore, do so.
>>>
>>> Does this patch mean that we will now ignore future breakages in
>>> shortlog and blame if their mailmap integration becomes buggy?
>>>
>>> I am not convinced it is a good idea if that is what is going on.
>>
>> I meant to mention in the cover letter that this patch was open for
>> debate, however, it does not eliminate all testing of these other
>> commands.
>>
>> The tests in which git-check-mailmap is substituted for git-shortlog
>> all worked against a simplistic two-commit repository. Those tests
>> were checking the low-level mailmap functionality under various
>> conditions and configurations; they were not especially checking any
>> particular behavior of git-shortlog.
>>
>> There still remain a final eight tests which cover git-shortlog,
>> git-log, and git-blame. These tests do check mailmap-related behavior
>> of those commands, and they do so using a more involved seven-commit
>> repository with "complex" mappings, so we have not necessarily lost
>> any checks of mailmap integration for those commands.
>>
>> Would this patch become more palatable if I stated the above in the
>> commit message?
>
> My current thinking is "no" --- the patch has as a justification "Now
> we can test these aspects of .mailmap handling directly with a
> low-level tool instead of using the tool most people will use, so do
> so", which sounds an awful lot like "Reduce test coverage of commonly
> used tools, because we can".
>
> But I imagine the actual motivation was something other than "because
> we can".

The motivation is as stated in the subject: Direct rather than indirect testing of mailmap functionality. The tests in question are properly crafted to check only low-level mailmap (not git-shortlog) functionality under various conditions and configurations, yet the mental load on the reader is high because he has to keep in mind the authors and commits in the repository underlying git-shortlog's output. When testing via git-check-mailmap, mental load is low: there is a direct correlation between the "Name <email@address>" which goes in and that which comes out. What is being tested is the same, but it's easier to reason about and understand the the tests when done directly.

When converting the tests, I also discovered an additional, perhaps more important motivation. Most of the tests check only that name remapping functions correctly, however, a couple also attempt to check address remapping (bugs@company.xx => bugs@company.xy). Even though the tests succeed, they don't actually prove that address remapping was correct (or occurred at all) since git-shortlog does not display the email address. git-check-mailmap always displays the email address, thus the check actually tests the intended email address remapping.

Show 6 quoted lines
> For example, maybe the idea is that after this patch, it
> should be easier to make cosmetic improvements to the shortlog, log,
> and blame output and only have to change those final 8 tests that are
> adequately covering the output?  If you have such plans and this patch
> makes them easier, it could sound like a good patch as a stepping
> stone toward that.
Previous: Jonathan NiederNext: Junio C Hamano
Message 14 of 18 in “add git-check-mailmap command”
  1. 0/4 add git-check-mailmap commandEric Sunshine, Jul 11, 2013
  2. 1/4 builtin: add git-check-mailmap commandEric Sunshine, Jul 11, 2013
  3. Junio C HamanoJul 11, 2013
  4. Eric SunshineJul 12, 2013
  5. Junio C HamanoJul 12, 2013
  6. Eric SunshineJul 12, 2013
  7. Junio C HamanoJul 12, 2013
  8. Eric SunshineJul 12, 2013
  9. 2/4 t4203: test check-mailmap command invocationEric Sunshine, Jul 11, 2013
  10. 3/4 t4203: test mailmap functionality directly rather than indirectlyEric Sunshine, Jul 11, 2013
  11. Junio C HamanoJul 11, 2013
  12. Eric SunshineJul 12, 2013
  13. Jonathan NiederJul 12, 2013
  14. Eric SunshineJul 12, 2013
  15. Junio C HamanoJul 12, 2013
  16. Eric SunshineJul 12, 2013
  17. Junio C HamanoJul 12, 2013
  18. 4/4 t4203: consolidate test-repository setupEric Sunshine, Jul 11, 2013

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.