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

Re: [PATCH 1/4] line-log: demonstrate a bug with nearly-overlapping ranges

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 6, 2018, 14:47 UTC
Message-ID
<20180806144726.GB97564@aiede.svl.corp.google.com>
In-Reply-To
<nycvar.QRO.7.76.6.1808061216060.71@tvgsbejvaqbjf.bet>
Hi Dscho,
Johannes Schindelin wrote:
> On Sat, 4 Aug 2018, Jonathan Nieder wrote:
Show 11 quoted lines
>> Alternatively, could it be squashed in with the patch that fixes it?
>
> There is this really awful trend on this mailing list to suggest
> conflating the demonstration of a bug with the bug fix.
>
> It is really, really important to realize how valuable it is to have the
> regression test as an individual patch that can be used to verify that
> there is a bug, to pinpoint where it was introduced, to test alternative
> fixes, to keep records separate, and I could go on and on and on. Please
> do not ignore these very good reasons, and please refrain from
> recommending such conflation in the future.

If you want to propose changing the project's style to always separate tests from the patch that fixes a bug, that's a discussion we can have, in a separate thread.

Today, we do allow and encourage putting the test with the patch that fixes it, and that has real advantages:

- the tests are easier to understand when found with "git log" because
  they are in context
- as the patch evolves, it is easier to remember to update the test at
  the same time
- newcomers imitating existing patches have a clear hint to write
  tests
- the beginning of a patch series can be applied and merged down while
  the end is still under review, without either leaving out the tests
  or applying a test that doesn't pass and accomplishes little

I've never found it difficult to use the test from a patch to verify that there is a bug or pinpoint where it was introduced. Tests are separate from the application code since they're in the t/ directory; this is a very easy thing to do. That isn't to say that a patch that only adds a (passing or expected-failure) test isn't valuable, even without a fix. It is valuable, precisely when it is self-explanatory.

More importantly, I am a bit surprised that instead of accepting the feedback, you are basically calling a reviewer complicit, for pointing out a pretty normal possible improvement that follows the project's conventions.

I'm beyond words.
Jonathan
Previous: Johannes SchindelinNext: Jonathan Nieder
Message 5 of 20 in “line-log: be more careful when adjusting multiple line ranges”
  1. 0/4 line-log: be more careful when adjusting multiple line rangesJohannes Schindelin via GitGitGadget, Aug 4, 2018
  2. 1/4 line-log: demonstrate a bug with nearly-overlapping rangesJohannes Schindelin via GitGitGadget, Aug 4, 2018
  3. Jonathan NiederAug 5, 2018
  4. Johannes SchindelinAug 6, 2018
  5. Jonathan NiederAug 6, 2018
  6. Jonathan NiederAug 6, 2018
  7. 2/4 line-log: adjust start/end of ranges individuallyJohannes Schindelin via GitGitGadget, Aug 4, 2018
  8. Eric SunshineAug 5, 2018
  9. Eric SunshineAug 5, 2018
  10. Johannes SchindelinAug 6, 2018
  11. 3/4 line-log: optimize ranges by joining them when possibleJohannes Schindelin via GitGitGadget, Aug 4, 2018
  12. Junio C HamanoAug 5, 2018
  13. Andrei RybakAug 5, 2018
  14. Eric SunshineAug 5, 2018
  15. 4/4 line-log: convert an assertion to a full BUG() callJohannes Schindelin via GitGitGadget, Aug 4, 2018
  16. Eric SunshineAug 5, 2018
  17. Johannes SchindelinAug 6, 2018
  18. Eric SunshineAug 7, 2018
  19. Eric SunshineAug 7, 2018
  20. Eric SunshineAug 5, 2018

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.