Subject: Re: [PATCH 02/11] git-p4: test debug macro

From: Luke Diamand <[email-masked]>
Date: Sat, 17 Dec 2011 22:43:18 +0000

On 17/12/11 18:52, Pete Wyckoff wrote:
> Call this from a test to have it pause and wait for you to
> investigate.  It prints out its current directory and the
> P4 environment variables.  It waits for ctrl-c before continuing
> the test.
>

Very useful, thanks!

> +# Go investigate when it pauses, then hit ctrl-c to continue the
> +# test.  The other tests will run, and p4d will be cleaned up nicely.
> +#
> +# Note that the directory is deleted and created for every test run,
> +# so you have to do the "cd" again.
> +#
> +debug() {
> +        echo "*** Debug me, hit ctrl-c when done.  Useful shell commands:"
> +        echo cd \"$(pwd)\"
> +        echo export P4PORT=$P4PORT P4CLIENT=$P4CLIENT
> +        trap echo SIGINT

Does that work with non-bash shells like ash? It didn't for me.

> +        sleep $((3600 * 24 * 30))
> +        trap - SIGINT
> +}
> +