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

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

 



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, <johan@xxxxxxxxxxx>
www.herland.net
--
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]