Re: [PATCH v8 36/41] apply: don't print on stdout when be_silent is set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Christian Couder <christian.couder@xxxxxxxxx> writes:

> This variable should prevent anything to be printed on both stderr
> and stdout.

You have to mention that skipping the entire callchain, not just the
"printing" part, is safe.  I can see numstat_patch_list() is
probably safe as it does not do any computation other than calling
printf() and write_name_quoted(), but other two are not immediately
obvious that what they compute are only used for their own printing
and there is no other side effects left to affect what happens after
this function returns.


> Signed-off-by: Christian Couder <chriscool@xxxxxxxxxxxxx>
> ---
>  apply.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/apply.c b/apply.c
> index 1435f85..e2acc18 100644
> --- a/apply.c
> +++ b/apply.c
> @@ -4698,13 +4698,13 @@ static int apply_patch(struct apply_state *state,
>  		goto end;
>  	}
>  
> -	if (state->diffstat)
> +	if (state->diffstat && !state->be_silent)
>  		stat_patch_list(state, list);
>  
> -	if (state->numstat)
> +	if (state->numstat && !state->be_silent)
>  		numstat_patch_list(state, list);
>  
> -	if (state->summary)
> +	if (state->summary && !state->be_silent)
>  		summary_patch_list(list);
>  
>  end:
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]