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

Re: 1.7.2 cycle will open soon

From
Jeff King <peff@peff.net>
Date
May 6, 2010, 05:52 UTC
Message-ID
<20100506055236.GA16151@coredump.intra.peff.net>
In-Reply-To
<7vaaselxe8.fsf@alter.siamese.dyndns.org>
On Tue, May 04, 2010 at 10:39:59PM -0700, Junio C Hamano wrote:
> It appears that the tip of 'maint' and 'next' (but curiously not 'master')
> do not pass test t1504 on at least FreeBSD right now, but I don't have
> enough energy to hunt things down tonight.

The culprit is Jonathan's 3bf7886 (test-lib: Let tests specify commands to be run at end of test, 2010-05-02). FreeBSD's /bin/sh doesn't propagate $? over an eval:

  $ /bin/sh
  $ false; echo $?
  1
  $ false; eval 'echo $?'
  0
  $ eval 'false; echo $?' ;# but it still works inside, of course
  1

Looking at that patch, I don't see any reason that eval_ret needs to be set inside the eval. If we have multiple test_when_finished calls, we keep setting and propagating eval_ret, which doesn't make much sense to me. Why not just:

  test_run_ () {
    test_cleanup=
    eval >&3 2>&4 "$1"
    eval_ret=$?
    eval >&3 2>&4 "$test_cleanup"
    return 0
  }
  test_when_finished () {
    test_cleanup="$*; $test_cleanup"
  }
Am I missing something?
-Peff
Previous: Junio C HamanoNext: Jonathan Nieder
Message 2 of 11 in “1.7.2 cycle will open soon”
  1. Junio C HamanoMay 5, 2010
  2. Jeff KingMay 6, 2010
  3. Jonathan NiederMay 6, 2010
  4. Jeff KingMay 6, 2010
  5. test-lib: some shells do not let $? propagate into an evalJonathan Nieder, May 6, 2010
  6. Jeff KingMay 6, 2010
  7. Junio C HamanoMay 6, 2010
  8. Johannes SixtMay 6, 2010
  9. Jeff KingMay 6, 2010
  10. Jonathan NiederMay 6, 2010
  11. Johannes SixtMay 6, 2010

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.