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

Re: [PATCH] test-lib: do not remove trash_directory if called with --debug

From
Jeff King <peff@peff.net>
Date
Aug 21, 2008, 12:55 UTC
Message-ID
<20080821125516.GA22453@coredump.intra.peff.net>
In-Reply-To
<7vy72qiwc0.fsf@gitster.siamese.dyndns.org>
On Thu, Aug 21, 2008 at 01:52:31AM -0700, Junio C Hamano wrote:
Show 6 quoted lines
> Yeah, I think hooking this with --debug is makes actual sense.  Much saner
> than changing the behaviour magically with "make -j".
> 
> Even though I personally do not particularly like having an _easy_ way to
> leave the cruft around, I'll apply it if Jeff and other people like this
> behaviour.

I think the workflow you described is probably a better one for adding a test, and I'll try to adjust to that. However, I do think Dscho's patch makes sense for any time you simply want to look at the output of a successful test (e.g., even if you aren't editing it).

My only concern with the patch is that it conditionally sets $remove_trash; if debug is set, that variable is not set at all. Yet later we look at it and "rm -rf" it. Obviously the chances of somebody accidentally passing in such a variable are quite low, but style-wise (and given that we are calling rm -rf!), I think I would prefer:

  if ! test -z "$debug"; then
    remove_trash="$TEST_DIRECTORY/$test"
  else
    remove_trash=
  fi

And a final comment on leaving cruft around: this is something that developers have to deal with _anyway_, when tests fail or when we break out of the test scripts with ^C. It eventually gets cleaned when the test runs successfully (or one runs "git clean -xd").

-Peff
Previous: Junio C HamanoNext: Michael J Gruber
Message 6 of 7 in “What's cooking in git.git (Aug 2008, #06; Wed, 20)”
  1. Junio C HamanoAug 21, 2008
  2. Jeff KingAug 21, 2008
  3. Junio C HamanoAug 21, 2008
  4. test-lib: do not remove trash_directory if called with --debugJohannes Schindelin, Aug 21, 2008
  5. Junio C HamanoAug 21, 2008
  6. Jeff KingAug 21, 2008
  7. Michael J GruberAug 21, 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.