Subject: Re: [PATCH v4 2/4] Add testcases for the --detect-dir-renames diffcore flag.

From: Andreas Ericsson <[email-masked]>
Date: Tue, 05 Oct 2010 11:21:58 +0200

On 10/04/2010 11:37 PM, Yann Dirson wrote:
> On Mon, Oct 04, 2010 at 03:32:41PM -0500, Jonathan Nieder wrote:
>> Yann Dirson wrote:
>>
>>> From: Yann Dirson<[email-masked]>
>>> Subject: Add testcases for the --detect-dir-renames diffcore flag
>>
>> Probably better for the test to be squashed with the patch that adds
>> that option.
> 
> I tend to agree, but we see quite a lot of patches split this way it
> seems.  Junio, any preference here ?
> 

Personally, I prefer adding the test first with "test_expect_failure"
and then changing it to test_expect_success in the patch that has the
real code changes. That way it's really easy to accept a testcase and
still keep altering how the test itself is fixed, which is usually a
far more complex and nitpickley process than showing that the bug is
there in the first place.

I know Junio has voiced the same preference for patchseries before and
especially when the solution isn't obvious. Note that I obviously can't
speak for him in any particular case.

Patches adding features should ofcourse have the code first and the
tests after, since the tests in that case are only about preventing
future breakage rather than showing that there is one now.

-- 
Andreas Ericsson                   [email-masked]
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.