Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: "Hanno Böck" <hanno@hboeck.de>
Cc: Taylor Blau <me@ttaylorr.com>,
	"brian m. carlson" <sandals@crustytoothpaste.net>,
	git@vger.kernel.org
Subject: Re: git push --quiet is not quiet
Date: Fri, 19 May 2023 05:05:59 -0400	[thread overview]
Message-ID: <20230519090559.GA3515410@coredump.intra.peff.net> (raw)
In-Reply-To: <20230519101505.416d0963.hanno@hboeck.de>

On Fri, May 19, 2023 at 10:15:05AM +0200, Hanno Böck wrote:

> I believe this is a bug in git: According to the man page for git push,
> the -q/--quiet parameter should "Suppress all output".
> 
> However, it does not. To reproduce: Create a commit in a repo and run:
> git push -q
> remote: Resolving deltas: 100% (1/1), completed with 1 local object.

That message is coming from the remote side over the stderr sideband; we
don't interpret it locally, so we don't know whether it's a real error
or just chatter. We must pass it on to the user. So the bug is that the
remote side is showing progress output, even though we've asked for
--quiet.

That is usually handled by sending a "quiet" capability over the
protocol. E.g., if you do something like this:

  git init --bare dst.git
  GIT_TRACE_PACKET=1 git push dst.git HEAD

You should see the server advertise that it knows about the "quiet"
capability:

  packet:         push< 0000000000000000000000000000000000000000 capabilities^{}\0report-status report-status-v2 delete-refs side-band-64k quiet atomic ofs-delta object-format=sha1 agent=git/2.41.0.rc0.368.gaafabc8979

And then when the client responds, it asks for "quiet":

  packet:         push> 0000000000000000000000000000000000000000 b2f0a7f47f5f2aebe1e7fceff19a57de20a78c06 refs/heads/master\0 report-status-v2 side-band-64k quiet object-format=sha1 agent=git/2.41.0.rc0.368.gaafabc8979

What is your push destination? If you run your push with GIT_TRACE_PACKET=1
in the environment, does the other side say that it supports "quiet"?

As a guess, I wondered if you might be pushing to GitHub. And indeed,
they do not support quiet. Here's the advertisement from pushing to a
test repo over ssh:

  push< 60e3601d029e7e4ed799be13225cbc221d7d9894 refs/heads/main\0report-status report-status-v2 delete-refs side-band-64k ofs-delta atomic push-options object-format=sha1 agent=github/spokes-receive-pack-14212a8c32379761bfb7c8707291458d5acdd11e

So I think this is a bug / lack of feature in GitHub's server
implementation.  It used to be a thin proxy around Git (and Git has
supported "quiet" since c207e34f7733 in 2012). But I suspect they may
have recently replaced it with something more custom (based on the agent
field).

+cc a few relevant GitHubbers

-Peff

  parent reply	other threads:[~2023-05-19  9:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  8:15 git push --quiet is not quiet Hanno Böck
2023-05-19  8:59 ` Kristoffer Haugsbakk
2023-05-19  9:05 ` Jeff King [this message]
2023-05-19  9:09   ` Hanno Böck
2023-05-19 20:42     ` Jeff King
2023-06-05 11:36   ` Taylor Blau
2023-06-06  1:57     ` Jeff King

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=20230519090559.GA3515410@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=hanno@hboeck.de \
    --cc=me@ttaylorr.com \
    --cc=sandals@crustytoothpaste.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).