Re: [PATCH 2/4] t4011: illustrate "diff-index -p" on stat-dirty paths

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zbigniew Jędrzejewski-Szmek <zbyszek@xxxxxxxxx> writes:

> On 03/01/2012 03:14 AM, Junio C Hamano wrote:
>> -test_expect_success SYMLINKS 'diff unchanged symlink'  '
>> +test_expect_success SYMLINKS 'diff unchanged symlink and file'  '
>>   	tree=$(git write-tree)&&
>> -	git update-index frotz&&
>> +	git update-index frotz nitfol&&
>>   	test -z "$(git diff-index --name-only $tree)"
>>   '
> why modify and extend an existing test instead of adding a new
> separate one?

If you are talking about assigning a new test number for a new script, it
is better to avoid it when you can.  If on the other hand you meant to add
a new "test_expect_success" block, yes, that is one of the right things to
consider when adding tests, and I tried it both ways.

The result was easier to read when done the way it was posted.

For this update, you could keep the later test that originally checked
symlink intact and add an identical check for regular file, but the thing
is, the behaviour change brought by the update in this series affect both
symlink and regular file comes from the same underlying mechanism, and
demonstrating the change in a single hunk that makes two phantom output
lines disappear was far easier to review than two hunks each of which
shows one phantom output line disapper.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]