git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] tests: grep portability fixes

From
Andreas Ericsson <ae@op5.se>
Date
Sep 30, 2008, 10:12 UTC
Message-ID
<48E1FB76.1040500@op5.se>
In-Reply-To
<20080930080355.GA19605@sigill.intra.peff.net>
Jeff King wrote:
Show 23 quoted lines
> We try to avoid using the "-q" or "-e" options, as they are
> largely useless, as explained in aadbe44f.
> 
> There is one exception for "-e" here, which is in t7701 used
> to produce an "or" of patterns. This can be rewritten as an
> egrep pattern.
> 
> This patch also removes use of "grep -F" in favor of the
> more widely available "fgrep".
> 
> Signed-off-by: Jeff King <peff@peff.net>
> ---
> 
> diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh
> index 4db4ac4..cb14425 100755
> --- a/t/t0002-gitfile.sh
> +++ b/t/t0002-gitfile.sh
> @@ -32,7 +32,7 @@ test_expect_success 'bad setup: invalid .git file format' '
>  		echo "git rev-parse accepted an invalid .git file"
>  		false
>  	fi &&
> -	if ! grep -qe "Invalid gitfile format" .err
> +	if ! grep "Invalid gitfile format" .err
Doesn't output need to be redirected when you drop '-q'?
Other than that, this looks good after a quick scan.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
Previous: Jeff KingNext: Johannes Sixt
Message 2 of 7 in “tests: grep portability fixes”
  1. tests: grep portability fixesJeff King, Sep 30, 2008
  2. Andreas EricssonSep 30, 2008
  3. Johannes SixtSep 30, 2008
  4. Jeff KingSep 30, 2008
  5. Johannes SixtSep 30, 2008
  6. Mike RalphsonSep 30, 2008
  7. Jeff KingSep 30, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.