Re: [PATCH] Allow combined diff to ignore white-spaces

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

 



Johannes Sixt <j.sixt@xxxxxxxxxxxxx> writes:

> This form of 'echo' is not sufficiently portable. How about:
>
> 	tr -d Q <<-\EOF >test &&
>
> 	always coalesce
> 	eol space coalesce Q
> ...
> 	EOF

Much better.

>> +test_expect_success 'check combined output (no ignore space)' '
>> +	git show | test_i18ngrep "^-\s*eol spaces" &&
>> ...
>> +	git show | test_i18ngrep "^--\s*always coalesce"
>
> This loses the exit code of git show. We usually write this as
>
> 	git show >actual &&
> 	grep "^- *eol spaces" &&
> 	grep "^- *eol space coalesce" &&
> 	...
>
> (Same for later tests.)
>
> There is nothing i18n-ish in the test patterns. Use regular grep.
>
> BTW, there is compare_diff_patch() in diff-lib.sh. You can use it to
> compare diff output to expected output. Then you do not need a grep
> invocation for each line of the test file.

All good suggestions.  Thanks.
--
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]