From: Jeff King Date: Fri, 26 Jan 2018 18:43:20 GMT Subject: Re: [PATCH 08/10] t: forbid piping into 'test_i18ngrep' Message-ID: <20180126184319.GE27618@sigill.intra.peff.net> In-Reply-To: On Fri, Jan 26, 2018 at 10:39:05AM -0800, Junio C Hamano wrote: > Is there a case where test_i18ngrep (after your clean-ups in this > series up to 06/10) needs to read from more than one file? > > I actually think that the kind of inconveniences we *can* work with, > without risking breakage to legitimate test, would be to allow and > require test_i18ngrep to name and read only from one file that > appears at the end of its command line. IOW, instead of doing a > probing "read" that you cannot undo and break legitimate test, I > think it is OK to see if the last token names a file that is on the > filesystem, e.g. > > test_i18ngrep () { > eval test -f \"\${$#}\" || > error "bug in the test sript: test_i18ngrep must" \ > "name a file to read as the last token on the command line" FWIW I like that much more than the weird "read" thing. It would also disallow "-", but we could make an exception for that if we choose to. -Peff