Re: [PATCH] checkout: be quiet if not on isatty()

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

 



Steffen Daode Nurpmeso <sdaoden@xxxxxxxxxxxxxx> writes:

> Signed-off-by: Steffen Daode Nurpmeso <sdaoden@xxxxxxxxx>

Justification is necessary why this is a good change.

Perhaps you meant something like this:

	In general, the progress output should not be given unless the
        output is sent to a tty (i.e. an interactive session).

But this patch may be squelching the output a bit too much. The opts.quiet
field is used not just to set verbose_update in the unpack_trees_options
used in reset_tree() and merge_working_tree(), but also used to report the
local changes at the end of merge_working_tree(), report tracking
information, and report where the detached HEAD is at, among other things.

Independently, it might make sense to squelch advice messages in a
non-interactive session, but I think that should probably be done by
flipping advice_* variables in advice.c, I think.

> ---
>  builtin/checkout.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/builtin/checkout.c b/builtin/checkout.c
> index 4eaedff..6fb6d48 100644
> --- a/builtin/checkout.c
> +++ b/builtin/checkout.c
> @@ -958,6 +958,7 @@ int cmd_checkout(int argc, const char **argv, const char *prefix)
>  	gitmodules_config();
>  	git_config(git_checkout_config, &opts);
>  
> +	opts.quiet = !isatty(2);
>  	opts.track = BRANCH_TRACK_UNSPECIFIED;
>  
>  	argc = parse_options(argc, argv, prefix, options, checkout_usage,
--
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]