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

Re: [PATCH 1/4] fix bsd shell negation

From
Junio C Hamano <junio@pobox.com>
Date
May 14, 2008, 02:27 UTC
Message-ID
<7viqxhr55h.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080513084452.GA23799@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> On some shells (notably /bin/sh on FreeBSD 6.1), the
> construct
>
>   ! foo | bar
>
> does not negate the exit value of the pipeline, but rather
> of 'foo', producing the opposite of the expected value. We
> can work around this by specifying it as
>
>   ! (foo | bar)
After applying this patch, we still seem to have fair number of hits:
    $ git grep -n -e '![^(]* |' -- '*.sh'

t/t5302-pack-index.sh:68: ! echo "$msg" | grep "pack too large .* off_t" t/t7002-grep.sh:111: ! git grep -c test $H | grep -q /dev/null t/t7600-merge.sh:378: if ! grep "^ file | *2 +-$" diffstat.txt t/t7600-merge.sh:392: if ! grep "^ file | *2 +-$" diffstat.txt t/t9400-git-cvsserver-server.sh:160: ! cat request-anonymous | t/t9400-git-cvsserver-server.sh:169: ! cat request-anonymous | t/t9400-git-cvsserver-server.sh:187: ! cat request-anonymous |

Didn't you have trouble with them, or the tests themselves are broken in some other way that these did not triggger?

    
    
Previous: Jeff KingNext: Jeff King
Message 3 of 13 in “freebsd portability fixes”
  1. 0/4 freebsd portability fixesJeff King, May 13, 2008
  2. 1/4 fix bsd shell negationJeff King, May 13, 2008
  3. Junio C HamanoMay 14, 2008
  4. Jeff KingMay 14, 2008
  5. 2/4 t5000: tar portability fixJeff King, May 13, 2008
  6. 3/4 clone: bsd shell portability fixJeff King, May 13, 2008
  7. 4/4 filter-branch: fix variable export logicJeff King, May 13, 2008
  8. Junio C HamanoMay 14, 2008
  9. Jeff KingMay 14, 2008
  10. Paolo BonziniMay 14, 2008
  11. Jeff KingMay 13, 2008
  12. Alex RiesenMay 13, 2008
  13. Alex RiesenMay 13, 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.