public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Josh Rabinowitz <joshr@joshr•com>
Cc: git@vger•kernel.org, "Larry D'Anna" <larry@elder-gods•org>,
	Tay Ray Chuan <rctay89@gmail•com>
Subject: Re: [PATCH] push: don't show Done with --quiet --porcelain
Date: Tue, 01 Sep 2015 10:13:20 -0700	[thread overview]
Message-ID: <xmqqvbburrkf.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CA+WR+g7frN4uV12dxahxZbr-5az7sj3zx2oN-Z3rKH0_Y8jqqg@mail.gmail.com> (Josh Rabinowitz's message of "Mon, 31 Aug 2015 12:40:45 -0400")

Josh Rabinowitz <joshr@joshr•com> writes:

> Change so 'git push --porcelain --quiet' emits no text when there
> is no error.  This makes the --quiet option here more consistent with
> other git commands.
>
> Signed-off-by: josh rabinowitz <joshr@joshr•com>
> ---

The rationale given in 77555854 (git-push: make git push --porcelain
print "Done", 2010-02-26) does not apply when "--quiet" is in use,
because we do give the rejection notice to the standard output even
under "--quiet", so the calling script can tell between the case
where we couldn't reach the remote side (i.e. no rejection notice)
and the case where we reached them and they rejected (i.e. they will
tell us why the push was rejected) when "git push" reports a failure
with its exit status.

For that matter, I am not sure if this "Done" introduced by 77555854
is really needed even when "--quiet" is not in effect.

In either case, saying "Done" after talking to the remote end
already is an established part of the output meant for Porcelain
when "--porcelain" option is in use.  So I do not think changing it
is a good idea.  Existing scripts that read from "--porcelain" output
would be expecting the line to be there.

>  transport.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/transport.c b/transport.c
> index 40692f8..0021b3f 100644
> --- a/transport.c
> +++ b/transport.c
> @@ -1209,7 +1209,7 @@ int transport_push(struct transport *transport,
>                 transport_update_tracking_ref(transport->remote, ref, verbose);
>         }
>
> -       if (porcelain && !push_ret)
> +       if (!quiet && porcelain && !push_ret)
>             puts("Done");
>         else if (!quiet && !ret && !transport_refs_pushed(remote_refs))
>             fprintf(stderr, "Everything up-to-date\n");
> --
> 2.3.2 (Apple Git-55)

  reply	other threads:[~2015-09-01 17:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 16:40 [PATCH] push: don't show Done with --quiet --porcelain Josh Rabinowitz
2015-09-01 17:13 ` Junio C Hamano [this message]
2015-09-04 13:11   ` Josh Rabinowitz
2015-09-04 21:42     ` Junio C Hamano
2015-09-10 20:23       ` Josh Rabinowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqvbburrkf.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=joshr@joshr$(echo .)com \
    --cc=larry@elder-gods$(echo .)org \
    --cc=rctay89@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox