Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Oct 30, 2015, 18:25 UTC
- Message-ID
- <alpine.DEB.1.00.1510301923010.31610@s15462909.onlinehome-server.info>
- In-Reply-To
- <20151027232848.GA4172@sigill.intra.peff.net>
Hi Peff,
On Tue, 27 Oct 2015, Jeff King wrote:
Show 17 quoted lines
> On Tue, Oct 27, 2015 at 09:34:48AM -0700, Junio C Hamano wrote: > > > Yeah, that was my first reaction when I saw this patch. Instead of > > having to munge that line to "gdb -whatever-args git", you can do a > > single-shot debugging in a convenient way. And quite honestly, > > because nobody sane will run: > > > > $ cd t && TEST_GDB_GIT=1 sh ./t1234-frotz.sh > > > > and can drive all the "git" running under gdb at the same time, I > > think what you showed would be the _only_ practical use case. > > 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=<n>` 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.
Ciao, Dscho