git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] push: don't show Done with --quiet --porcelain

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 1, 2015, 17:13 UTC
Message-ID
<xmqqvbburrkf.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CA+WR+g7frN4uV12dxahxZbr-5az7sj3zx2oN-Z3rKH0_Y8jqqg@mail.gmail.com>
Josh Rabinowitz <joshr@joshr.com> writes:
Show 6 quoted lines
> 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.

Show 18 quoted lines
>  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)
Previous: Josh RabinowitzNext: Josh Rabinowitz
Message 2 of 5 in “push: don't show Done with --quiet --porcelain”
  1. push: don't show Done with --quiet --porcelainJosh Rabinowitz, Aug 31, 2015
  2. Junio C HamanoSep 1, 2015
  3. Josh RabinowitzSep 4, 2015
  4. Junio C HamanoSep 4, 2015
  5. Josh RabinowitzSep 10, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.