From: Jeff King Date: Fri, 30 Oct 2015 19:26:52 GMT Subject: Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb Message-ID: <20151030192652.GA5336@sigill.intra.peff.net> In-Reply-To: On Fri, Oct 30, 2015 at 07:25:24PM +0100, Johannes Schindelin wrote: > > I agree doing so would be crazy. But would: > > > > ./t1234-frotz.sh --gdb=17 > > > > be sane to run gdb only inside test 17? > > It would probably be sane, but I never encountered the need for something > like that. It was always much easier to run the test using `sh -x t... -i > -v` to find out what command was behaving funnily (mind you, that can be a > pretty hard thing todo, we have some quite convoluted test scripts in our > code base) and then edit the test. > > I would expect that `--gdb=` thing to drive me crazy: first, I would > choose the wrong number. Next, I would probably forget that test_commit > and other commands *also* calls Git. Yeah, good points. You somehow have to say "debug _this_ git invocation", and there is probably not a more precise way to do that than sticking something in the code on the right line. I do think I like Junio's "debug git foo" rather than setting the environment variable, as its syntactically a little simpler to type (and of course it would probably be implemented with an environment variable, so one could whichever style they prefer). -Peff