Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCHv5 20/23] git notes merge: Add testcases for merging notes trees at different fanouts

From: Johan Herland <hidden>
Date: 2016-06-15 22:49:57

Possibly related (same subject, not in this thread)

On Friday 29 October 2010, Junio C Hamano wrote:
Subject: [PATCH] portability fix for [20/23]

    test "$(line generator | wc -l)" = $expected_number_of_lines (bad)

is not portable, as "wc -l" can prefix the number with whitespaces.

Either write the $(... | wc -l) without enclosing in a dq pair, i.e.

    test $(line generator | wc -l) = $expected_number_of_lines (good)

or compare them numerically with

    test "$(... | wc -l)" -eq $num (ok)

The former is preferred for readability.
Ack. I'll fold this fix into the next iteration.

Thanks!

...Johan

-- 
Johan Herland, [off-list ref]
www.herland.net
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help