From: Jeff King Date: Fri, 03 Aug 2012 23:08:04 GMT Subject: Re: [PATCH] tests: Introduce test_seq Message-ID: <20120803230804.GA14447@sigill.intra.peff.net> In-Reply-To: <7vr4rna8y4.fsf@alter.siamese.dyndns.org> On Fri, Aug 03, 2012 at 03:48:19PM -0700, Junio C Hamano wrote: > Michał Kiedrowicz writes: > > > Jeff King wrote: > > > > The seq command is GNU-ism, and is missing at least in older BSD > > releases and their derivatives, not to mention antique > > commercial Unixes. > > > > We already purged it in b3431bc (Don't use seq in tests, not > > everyone has it, 2007-05-02), but a few new instances have crept > > in. They went unnoticed because they are in scripts that are not > > run by default. > > > > Replace them with test_seq that is implemented with a Perl snippet > > (proposed by Jeff). This is better than inlining this snippet > > everywhere it's needed because it's easier to read and it's easier to > > change the implementation (e.g. to C) if we ever decide to remove Perl > > from the test suite. > > > > Note that test_seq is not a complete replacement for seq(1). It just > > has what we need now. > > > > There are also many places that do `for i in 1 2 3 ...` but I'm not sure > > if it's worth converting them to test_seq. That would introduce running > > more processes of Perl. > > > > Signed-off-by: Michał Kiedrowicz > > --- > > Thanks; Jeff, ack? Yeah, Acked-by: Jeff King > > + "$PERL_PATH" -le 'print for "$ARGV[0]".."$ARGV[1]"' "$first" "$last" > > I'd prefer not to have dq around $ARGV[]; is there a reason to have > one around these? I don't think they accomplish anything, and it is slightly easier to read without them. I'm fine either way. -Peff