# [PATCH] run_command(): respect GIT_TRACE

2 messages from 2008-07-07 to 2008-07-07. Participants: Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/14324

## Johannes Schindelin, 2008-07-07 13:41

Subject: [PATCH] run_command(): respect GIT_TRACE
Message-ID: <alpine.DEB.1.00.0807071441190.18205@racer>
URL: https://gitlist.dev/e/alpine.DEB.1.00.0807071441190.18205%40racer

```

When GIT_TRACE is set, the user is most likely wanting to see an external
command that is about to be executed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 run-command.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/run-command.c b/run-command.c
index 2ce8c2b..6e29fdf 100644
--- a/run-command.c
+++ b/run-command.c
@@ -65,6 +65,8 @@ int start_command(struct child_process *cmd)
 		cmd->err = fderr[0];
 	}
 
+	trace_argv_printf(cmd->argv, "trace: run_command:");
+
 #ifndef __MINGW32__
 	cmd->pid = fork();
 	if (!cmd->pid) {
-- 
1.5.6.2.402.g95b5ab.dirty

```

## Junio C Hamano, 2008-07-07 20:00

Subject: Re: [PATCH] run_command(): respect GIT_TRACE
Message-ID: <7v4p7131np.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v4p7131np.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <alpine.DEB.1.00.0807071441190.18205@racer>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> When GIT_TRACE is set, the user is most likely wanting to see an external
> command that is about to be executed.

I haven't checked to see if none of the callers of start_command() assumes
the current behaviour and is printing this information itself instead, but
other than that, your justification feels very sensible.

Thanks.

> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
>  run-command.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/run-command.c b/run-command.c
> index 2ce8c2b..6e29fdf 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -65,6 +65,8 @@ int start_command(struct child_process *cmd)
>  		cmd->err = fderr[0];
>  	}
>  
> +	trace_argv_printf(cmd->argv, "trace: run_command:");
> +
>  #ifndef __MINGW32__
>  	cmd->pid = fork();
>  	if (!cmd->pid) {
> -- 
> 1.5.6.2.402.g95b5ab.dirty

```
