Re: [PATCH] run-command: use strbuf_addstr() for adding a string to a strbuf

2018-03-25 Thread Junio C Hamano
René Scharfe  writes:

> Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.
>
> Signed-off-by: Rene Scharfe 
> ---
> That line was added by e73dd78699 (run-command.c: introduce
> trace_run_command()).

Thanks.

>
>  run-command.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/run-command.c b/run-command.c
> index a483d5904a..84899e423f 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -621,7 +621,7 @@ static void trace_run_command(const struct child_process 
> *cp)
>   if (!trace_want(_default_key))
>   return;
>  
> - strbuf_addf(, "trace: run_command:");
> + strbuf_addstr(, "trace: run_command:");
>   if (cp->dir) {
>   strbuf_addstr(, " cd ");
>   sq_quote_buf_pretty(, cp->dir);


Re: [PATCH] run-command: use strbuf_addstr() for adding a string to a strbuf

2018-03-25 Thread Duy Nguyen
On Sun, Mar 25, 2018 at 12:57 PM, René Scharfe  wrote:
> Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.
>
> Signed-off-by: Rene Scharfe 
> ---
> That line was added by e73dd78699 (run-command.c: introduce
> trace_run_command()).
>
>  run-command.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/run-command.c b/run-command.c
> index a483d5904a..84899e423f 100644
> --- a/run-command.c
> +++ b/run-command.c
> @@ -621,7 +621,7 @@ static void trace_run_command(const struct child_process 
> *cp)
> if (!trace_want(_default_key))
> return;
>
> -   strbuf_addf(, "trace: run_command:");
> +   strbuf_addstr(, "trace: run_command:");

Obviously correct. Ack.

> if (cp->dir) {
> strbuf_addstr(, " cd ");
> sq_quote_buf_pretty(, cp->dir);
> --
> 2.16.3



-- 
Duy


[PATCH] run-command: use strbuf_addstr() for adding a string to a strbuf

2018-03-25 Thread René Scharfe
Patch generated with Coccinelle and contrib/coccinelle/strbuf.cocci.

Signed-off-by: Rene Scharfe 
---
That line was added by e73dd78699 (run-command.c: introduce
trace_run_command()).

 run-command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/run-command.c b/run-command.c
index a483d5904a..84899e423f 100644
--- a/run-command.c
+++ b/run-command.c
@@ -621,7 +621,7 @@ static void trace_run_command(const struct child_process 
*cp)
if (!trace_want(_default_key))
return;
 
-   strbuf_addf(, "trace: run_command:");
+   strbuf_addstr(, "trace: run_command:");
if (cp->dir) {
strbuf_addstr(, " cd ");
sq_quote_buf_pretty(, cp->dir);
-- 
2.16.3