Subject: Re: [RFC/PATCH] transport-helper: initialize debug flag before starting threads

From: Jeff King <[email-masked]>
Date: Mon, 8 Dec 2014 05:36:24 -0500

On Mon, Dec 08, 2014 at 03:22:06AM -0500, Jeff King wrote:

>  /* Print bidirectional transfer loop debug message. */
>  __attribute__((format (printf, 1, 2)))
>  static void transfer_debug(const char *fmt, ...)
>  {
>  	va_list args;
>  	char msgbuf[PBUFFERSIZE];
> -	static int debug_enabled = -1;
>  
> -	if (debug_enabled < 0)
> -		debug_enabled = getenv("GIT_TRANSLOOP_DEBUG") ? 1 : 0;
> -	if (!debug_enabled)
> +	if (!transport_debug_enabled)
>  		return;

I think in my cover letter I made clear that this was not really meant
for inclusion as-is, but just in case: this obviously is missing "()" at
the end of the function call (interestingly gcc -Wall complains, but
clang does not).

-Peff