RE: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-11-01 Thread Johannes Schindelin
Hi Victor, On Sat, 31 Oct 2015, Victor Leschuk wrote: > > > +if test -n "$TEST_GDB_GIT" > > > +then > > > + exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@" > > Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be > > useful > > to contain "gdb" executable name. It would all

RE: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-31 Thread Victor Leschuk
> > +if test -n "$TEST_GDB_GIT" > > +then > > + exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@" > Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful > to contain "gdb" executable name. It would allow to set path to GDB when it > is not in $PATH, set different debugg

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Junio C Hamano
Jeff King writes: > At the risk of repeating what I just said elsewhere in the thread, I > think this patch is the best of the proposed solutions. OK, will queue. I agree that more could be built on top, instead of polishing this further in place. Thanks. -- To unsubscribe from this list: send

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Jonathan Nieder
Jeff King wrote: > Somebody suggested elsewhere that the name "gdb" be configurable. We > could stick that in the same variable, like: > > test "$GIT_TEST_GDB" = 1 && GIT_TEST_GDB=gdb > exec ${GIT_TEST_GDB} --args ... > > but that does not play well with the "debug" function, which does not >

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Jeff King
On Fri, Oct 30, 2015 at 12:02:56PM -0700, Jonathan Nieder wrote: > > I'd just be happy as long as the feature becomes available, and I'd > > leave the choice of consistent and convenient naming to others who > > have stronger opinions ;-) > > Here's a suggested patch. > > -- >8 -- > From: Johann

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Jeff King
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

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Johannes Schindelin
Hi Jonathan, On Fri, 30 Oct 2015, Jonathan Nieder wrote: > Junio C Hamano wrote: > > Johannes Schindelin writes: > >> On Tue, 27 Oct 2015, Junio C Hamano wrote: > > >>> It can be called GDB=1, perhaps? > >> > >> No, this is way too generic. As I only test that the environment > >> variable's ex

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Jonathan Nieder
Junio C Hamano wrote: > Johannes Schindelin writes: >> On Tue, 27 Oct 2015, Junio C Hamano wrote: >>> It can be called GDB=1, perhaps? >> >> No, this is way too generic. As I only test that the environment >> variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would >> trigger it.

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Jonathan Nieder
Johannes Schindelin wrote: > On Tue, 27 Oct 2015, Johannes Schindelin wrote: >> On Mon, 26 Oct 2015, Jonathan Nieder wrote: >>> Does the 'exec' after the fi need this as well? exec is supposed to >>> itself print a message and exit when it runs into an error. [...] > Actually, after reading the p

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Johannes Schindelin
Hi Victor, On Thu, 29 Oct 2015, Victor Leschuk wrote: > > +if test -n "$TEST_GDB_GIT" > > +then > > + exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@" > Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful > to contain "gdb" executable name. It would allow to set path

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Junio C Hamano
Johannes Schindelin writes: > Hi Junio, > > On Tue, 27 Oct 2015, Junio C Hamano wrote: > >> It can be called GDB=1, perhaps? > > No, this is way too generic. As I only test that the environment > variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would > trigger it. > > I could be

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Johannes Schindelin
Hi Jonathan, On Tue, 27 Oct 2015, Johannes Schindelin wrote: > On Mon, 26 Oct 2015, Jonathan Nieder wrote: > > > Does the 'exec' after the fi need this as well? exec is supposed to > > itself print a message and exit when it runs into an error. Would > > including an 'else' with the if make th

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Johannes Schindelin
Hi Junio, On Tue, 27 Oct 2015, Junio C Hamano wrote: > It can be called GDB=1, perhaps? No, this is way too generic. As I only test that the environment variable's existence, even something like GDB=/usr/opt/gdb/bin/gdb would trigger it. I could be talked into GDB_GIT=1, though. Ciao, Dscho --

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-30 Thread Johannes Schindelin
Hi Peff, On Tue, 27 Oct 2015, Jeff King wrote: > 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 conven

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-29 Thread Junio C Hamano
Duy Nguyen writes: > On Mon, Oct 26, 2015 at 2:15 PM, Johannes Schindelin > wrote: >> When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it >> will now be run with GDB, allowing the developer to debug test failures >> more conveniently. > > I'm very slowly catching up with git t

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-28 Thread Victor Leschuk
+if test -n "$TEST_GDB_GIT" +then + exec gdb -args "${GIT_EXEC_PATH}/@@PROG@@" "$@" Maybe we could make $TEST_GDB_GIT not just a boolean flag? It would be useful to contain "gdb" executable name. It would allow to set path to GDB when it is not in $PATH, set different debuggers (for e

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Jeff King
On Tue, Oct 27, 2015 at 04:39:37PM -0700, Stefan Beller wrote: > On Tue, Oct 27, 2015 at 4:28 PM, Jeff King wrote: > > I agree doing so would be crazy. But would: > > > > ./t1234-frotz.sh --gdb=17 > > > > be sane to run gdb only inside test 17? > > OT: > We have two ways of addressing tests, b

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Stefan Beller
On Tue, Oct 27, 2015 at 4:28 PM, Jeff King wrote: > I agree doing so would be crazy. But would: > > ./t1234-frotz.sh --gdb=17 > > be sane to run gdb only inside test 17? OT: We have two ways of addressing tests, by number and by name. Usually when a test fails ("Foo gobbles the bar correctly" f

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Jeff King
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 r

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Duy Nguyen
On Mon, Oct 26, 2015 at 2:15 PM, Johannes Schindelin wrote: > When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it > will now be run with GDB, allowing the developer to debug test failures > more conveniently. I'm very slowly catching up with git traffic. Apologies if it's alrea

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Junio C Hamano
Johannes Schindelin writes: >> Most TEST_ environment variables that git respects are under >> GIT_TEST_* --- e.g., GIT_TEST_OPTS. Should this match that pattern >> as well, for easier debugging with commands like 'env | grep GIT_'? > > I dunno. This variable is most useful when inserted into th

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-27 Thread Johannes Schindelin
Hi Jonathan, On Mon, 26 Oct 2015, Jonathan Nieder wrote: > Johannes Schindelin wrote: > > > --- a/wrap-for-bin.sh > > +++ b/wrap-for-bin.sh > > @@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@@BUILD_DIR@@/po/build/locale' > > PATH='@@BUILD_DIR@@/bin-wrappers:'"$PATH" > > export GIT_EXEC_PATH GITPERLLIB

Re: [PATCH 3/6] Facilitate debugging Git executables in tests with gdb

2015-10-26 Thread Jonathan Nieder
Johannes Schindelin wrote: > When prefixing a Git call in the test suite with 'TEST_GDB_GIT=1 ', it > will now be run with GDB, allowing the developer to debug test failures > more conveniently. Neat. [...] > --- a/wrap-for-bin.sh > +++ b/wrap-for-bin.sh > @@ -19,4 +19,11 @@ GIT_TEXTDOMAINDIR='@