Re: [PATCH v2 2/3] clean up some of the output from git push --porcelain

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

 



Larry D'Anna <larry@xxxxxxxxxxxxxx> writes:

> diff --git a/builtin-push.c b/builtin-push.c
> index 0a27072..ff0b1c6 100644
> --- a/builtin-push.c
> +++ b/builtin-push.c
> @@ -123,7 +123,7 @@ static int push_with_options(struct transport *transport, int flags)
>  	if (!err)
>  		return 0;
>  
> -	if (nonfastforward && advice_push_nonfastforward) {
> +	if (!(flags & TRANSPORT_PUSH_PORCELAIN) && nonfastforward && advice_push_nonfastforward) {

I suspect that it would be a much nicer solution if you turned advice_*
off in very early parts of the codepath after you read configuration and
command line options to see if --porcelain was asked for.  That way, we
don't have to add code check for PORCELAIN next time we add code for new
kinds of advice.  People who are adding new advice_* would grep for
existing one (e.g. "advice_push_nonfastforward") and will notice this
line, but if you had

	if (flags & TRANSPORT_PUSH_PORDCELAIN) {
        	advice_push_nonfastforward = 0;
	}

in early parts of the code, they will notice that as well, and then they
know where to add the corresponding change necessary.
--
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]