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

Re: [PATCH] filter-branch: get rid of "set -e"

From
David Kastrup <dak@gnu.org>
Date
Jul 18, 2007, 13:27 UTC
Message-ID
<86vechj0zz.fsf@lola.quinscape.zz>
In-Reply-To
<Pine.LNX.4.64.0707181416050.14781@racer.site>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> It was reported by Alex Riesen that "set -e" can break something as 
> trivial as "unset CDPATH" in bash.

Not in bash. Just tried it. But there are Bourne shells that do get annoyed.

> So get rid of "set -e".
I'd rather write
[ "X$CDPATH" = "X" ] || unset CDPATH

With regard to shells, there is an interesting document (info "(autoconf) Portable Shell") which is rather disillusioning.

A real horror show is (info "(autoconf) Limitations of Builtins") where one learns that using if without else can lead to bad exit status, too.

-- 
David Kastrup
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 7 in “git-filter-branch exits early”
  1. Alex RiesenJul 10, 2007
  2. Johannes SchindelinJul 10, 2007
  3. Alex RiesenJul 11, 2007
  4. Sven VerdoolaegeJul 11, 2007
  5. filter-branch: get rid of "set -e"Johannes Schindelin, Jul 18, 2007
  6. David KastrupJul 18, 2007
  7. Johannes SchindelinJul 18, 2007

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.