[PATCH 0/4] Re: [PATCH 3/4] t: rev-parse-parents: avoid yoda conditions
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Sep 3, 2013, 17:04 UTC
- Message-ID
- <20130903170419.GA29921@google.com>
- In-Reply-To
- <20130903150855.GK29840@goldbirke>
SZEDER Gábor wrote:
> On Tue, Sep 03, 2013 at 08:39:54AM -0500, Felipe Contreras wrote:
Show 6 quoted lines
>> There are two ways to fix an inconsistency, the other way is to fix >> test_cmp. But that would be a change, and change is not welcome in >> Git. > > It depends on the change, I suppose. I agree, changing 3k+ lines just > to avoid yoda conditions... I doubt the gain worth the code churn.
Especially when the idiom being changed is not even being made better. ;-)
test_cmp_rev follows the same order of arguments a "diff -u" and produces the same output as plain "git diff". It's perfectly readable and normal. I think Felipe is pushing buttons and testing boundaries.
But in the process came a report of a missing test_cmp_rev use, which is useful. Patch follows.
While at it, I rerolled the other patches from the series to clarify their commit messages (replacing "fix <something>" with a fuller description).
Improvements welcome, as always. Thanks.
Felipe Contreras (3): rev-parse test: modernize quoting and whitespace rev-parse test: use test_must_fail, not "if <command>; then false; fi" rev-parse test: use standard test functions for setup
Jonathan Nieder (1): rev-parse test: use test_cmp instead of "test" builtin
t/t6101-rev-parse-parents.sh | 110 +++++++++++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 31 deletions(-)