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

Re: [PATCH 1/2] t750*: make tests for commit messages more pedantic

From
Junio C Hamano <gitster@pobox.com>
Date
May 28, 2015, 18:55 UTC
Message-ID
<xmqqh9qwh6py.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CAPig+cRHB3Qzm-e1_KROu2RQoW2rftLH=uKrWQBsnW0EYkcLPw@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 14 quoted lines
> On Tue, May 26, 2015 at 2:15 AM, Patryk Obara <patryk.obara@gmail.com> wrote:
>> Currently messages are compared with --pretty=format:%s%b which does
>> not retain raw format of commit message. In result it's not clear what
>> part of expected commit msg is subject and what part is body. Also, it's
>> impossible to test if messages with multiple lines are handled
>> correctly, which may be significant when using nondefault --cleanup.
>
> Makes sense.
> ...
>> +test_expect_success 'template without newline before eof should work with --status' '
>
> It's not clear what "should work" means. I suppose you mean that the
> end result should have exactly one newline after the template. Perhaps
> the test title could indicate the intent more clearly.
I agree that what "should work" in this title is unclear.

Because there is nothing wrong in the current system, if a follow-up patch plans to change the established behaviour, the tests in this "currently we do not test blank lines, so add tests for them" patch should limit themselves to document the current behaviour.

Then a follow-up patch that modifies the behaviour can show how the updated behaviour is different and illustrate in what way it is better than the current behaviour. That would be one way to justify the change.

Previous: Eric SunshineNext: Patryk Obara
Message 4 of 14 in “commit -t appends newline after template file”
  1. 0/2 commit -t appends newline after template filePatryk Obara, May 26, 2015
  2. 1/2 t750*: make tests for commit messages more pedanticPatryk Obara, May 26, 2015
  3. Eric SunshineMay 28, 2015
  4. Junio C HamanoMay 28, 2015
  5. 2/2 commit: fix ending newline for template filesPatryk Obara, May 26, 2015
  6. Eric SunshineMay 28, 2015
  7. Junio C HamanoMay 28, 2015
  8. Eric SunshineMay 28, 2015
  9. Junio C HamanoMay 29, 2015
  10. Eric SunshineMay 29, 2015
  11. Patryk ObaraMay 30, 2015
  12. Eric SunshineMay 31, 2015
  13. Junio C HamanoMay 30, 2015
  14. Patryk ObaraMay 28, 2015

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.