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

Re: [PATCH] test_interactive: interactive debugging in test scripts

From
Jeff King <peff@peff.net>
Date
Jan 16, 2012, 20:19 UTC
Message-ID
<20120116201922.GB18699@sigill.intra.peff.net>
In-Reply-To
<20120116154953.GA21238@padd.com>
On Mon, Jan 16, 2012 at 10:49:53AM -0500, Pete Wyckoff wrote:
> And it is necessary to export any test variables you want to use
> in the debug shell.  I often cut-n-paste lines containing
> TEST_DIRECTORY and TRASH_DIRECTORY; there could be others,
> in test scripts and helper libraries too.

Yeah, exporting a few common ones would be helpful. I really wish there was a way to ask a shell to stop running the script and start doing interactive things in the current shell context, but no such thing exists AFAIK (you can hack it with a read-eval loop, but you are missing many of the useful input-handling bits like tab completion. Hmm, I wonder if bash's "read -e" would be enough, though).

I kind of wonder if that is over-engineering, though. I'd like a perfect debugging environment, but the fact of the matter is that writing, maintaining, and making it work in every case that comes up is probably a lot more work than just fiddling with the scripts now and then. This code isn't even meant to be run except in such fiddling circumstances.

Show 8 quoted lines
> While it would be nice to use:
> 
>     test_interactive gdb --args git ...
> 
> the path is setup to invoke the script in bin-wrappers/git,
> requiring either --with-dashes or something like
> 
>     test_interactive gdb --args "$GIT_EXEC_PATH"/git ...

Yeah. I have before patched the bin-wrappers script to accept a GIT_WRAPPER_PREFIX variable, so you can just set that and have it run gdb on your invocation. But even that's not enough for externals. I've been tempted to actually carry around a run-time option to exec externals via gdb, but I didn't want to pollute the regular code base (and you can usually get by with just running "gdb git-foo" directly).

-Peff
Previous: Pete WyckoffNext: Junio C Hamano
Message 8 of 12 in “test-lib: add the test_bash convenience function”
  1. test-lib: add the test_bash convenience functionJens Lehmann, Jan 15, 2012
  2. Jeff KingJan 15, 2012
  3. test_interactive: interactive debugging in test scriptsPete Wyckoff, Jan 16, 2012
  4. Jens LehmannJan 16, 2012
  5. Jeff KingJan 16, 2012
  6. Jens LehmannJan 16, 2012
  7. Pete WyckoffJan 16, 2012
  8. Jeff KingJan 16, 2012
  9. Junio C HamanoJan 16, 2012
  10. test-lib: add the test_pause convenience functionJens Lehmann, Jan 17, 2012
  11. Junio C HamanoJan 17, 2012
  12. test-lib: add the test_pause convenience functionJens Lehmann, Jan 17, 2012

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.