Git Mailing List Archive mirror
 help / color / mirror / Atom feed
* git push --quiet is not quiet
@ 2023-05-19  8:15 Hanno Böck
  2023-05-19  8:59 ` Kristoffer Haugsbakk
  2023-05-19  9:05 ` Jeff King
  0 siblings, 2 replies; 7+ messages in thread
From: Hanno Böck @ 2023-05-19  8:15 UTC (permalink / raw)
  To: git

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.


[System Info]
git version:
git version 2.40.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.3.3 #1 SMP Thu May 18 21:38:29 CEST 2023 x86_64
compiler info: gnuc: 13.1
libc info: glibc: 2.37
$SHELL (typically, interactive shell): /bin/bash


-- 
Hanno Böck
https://hboeck.de/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  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
  1 sibling, 0 replies; 7+ messages in thread
From: Kristoffer Haugsbakk @ 2023-05-19  8:59 UTC (permalink / raw)
  To: Hanno Böck; +Cc: git

Hi

On Fri, May 19, 2023, at 10:15, 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".

Looks like the message is coming from the remote. If I make a fresh
fresh commit in a fork I get this message from GitHub:

```
remote:
remote: Create a pull request for 'test-push' on GitHub by visiting:
remote:      https://github.com/LemmingAvalanche/git/pull/new/test-push
remote:
```

The delta message has the same `remote:` prefix.

`git push --quiet` does keep quiet when I test it locally (i.e. no
interference from the forge).

-- 
Kristoffer Haugsbakk

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  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
  2023-05-19  9:09   ` Hanno Böck
  2023-06-05 11:36   ` Taylor Blau
  1 sibling, 2 replies; 7+ messages in thread
From: Jeff King @ 2023-05-19  9:05 UTC (permalink / raw)
  To: Hanno Böck; +Cc: Taylor Blau, brian m. carlson, git

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  2023-05-19  9:05 ` Jeff King
@ 2023-05-19  9:09   ` Hanno Böck
  2023-05-19 20:42     ` Jeff King
  2023-06-05 11:36   ` Taylor Blau
  1 sibling, 1 reply; 7+ messages in thread
From: Hanno Böck @ 2023-05-19  9:09 UTC (permalink / raw)
  To: Jeff King; +Cc: Taylor Blau, brian m. carlson, git

On Fri, 19 May 2023 05:05:59 -0400
Jeff King <peff@peff.net> wrote:

> As a guess, I wondered if you might be pushing to GitHub.

Yes.

> 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).

Ok, interesting. Maybe add to this: it appears github sometimes uses
this channel to send relevant messages, e.g. dependabot alerts. Which I
guess is a good thing, but it probably shouldn't send status messages
for normal commits when the user asks for "quiet".

-- 
Hanno Böck
https://hboeck.de/

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  2023-05-19  9:09   ` Hanno Böck
@ 2023-05-19 20:42     ` Jeff King
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2023-05-19 20:42 UTC (permalink / raw)
  To: Hanno Böck; +Cc: Taylor Blau, brian m. carlson, git

On Fri, May 19, 2023 at 11:09:37AM +0200, Hanno Böck wrote:

> > 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).
> 
> Ok, interesting. Maybe add to this: it appears github sometimes uses
> this channel to send relevant messages, e.g. dependabot alerts. Which I
> guess is a good thing, but it probably shouldn't send status messages
> for normal commits when the user asks for "quiet".

Yeah, that makes sense. Hooks should respect the "quiet" flag, too, as
appropriate. But the problem here is that because the server does not
claim to support the "quiet" capability, the client is not even passing
along the message that the user asked for "--quiet".

Presumably once that is fixed, the custom messages from the server would
then respect the quiet flag. But it's possible there might be more work
needed there, too.

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  2023-05-19  9:05 ` Jeff King
  2023-05-19  9:09   ` Hanno Böck
@ 2023-06-05 11:36   ` Taylor Blau
  2023-06-06  1:57     ` Jeff King
  1 sibling, 1 reply; 7+ messages in thread
From: Taylor Blau @ 2023-06-05 11:36 UTC (permalink / raw)
  To: Jeff King; +Cc: Hanno Böck, brian m. carlson, git

On Fri, May 19, 2023 at 05:05:59AM -0400, Jeff King wrote:
> 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

Sorry for missing this. Indeed, this is a missing feature from GitHub's
custom reimplementation of receive-pack [1]. The rollout of this new
implementation is relatively recent, which is probably why this wasn't
noticed until Hanno wrote about it.

I mentioned this to the team that is working on spokes-receive-pack, and
they have graciously implemented support for the quiet capability here:

  https://github.com/github/spokes-receive-pack/pull/49

Hopefully that gets merged and rolled out soon, at which point I think
we can call it a day here.

Thanks,
Taylor

[1]: https://github.com/github/spokes-receive-pack


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git push --quiet is not quiet
  2023-06-05 11:36   ` Taylor Blau
@ 2023-06-06  1:57     ` Jeff King
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff King @ 2023-06-06  1:57 UTC (permalink / raw)
  To: Taylor Blau; +Cc: Hanno Böck, brian m. carlson, git

On Mon, Jun 05, 2023 at 07:36:25AM -0400, Taylor Blau wrote:

> I mentioned this to the team that is working on spokes-receive-pack, and
> they have graciously implemented support for the quiet capability here:
> 
>   https://github.com/github/spokes-receive-pack/pull/49
> 
> Hopefully that gets merged and rolled out soon, at which point I think
> we can call it a day here.

Ah, cool, I didn't realize the implementation was open source. That pull
request looks like what I'd expect (from my obviously brief look at the
code).

I wondered that it did not pass along any kind of "quiet" designation to
the hooks (who might want to be less chatty in that case). But it
doesn't look like git-receive-pack does, either. So at least
spokes-receive-pack will be on par with git.git. :)

I do think it would be a potentially useful feature for receive-pack to
pass on the information that it got a "quiet" capability request from
the client (probably through the environment). But if people aren't
complaining about it, it's probably not a high priority.  The only
discussion I could find was this thread from a few years ago:

  https://lore.kernel.org/git/ba70b25b-906c-0117-2594-c606595c6816@redhat.com/

but it didn't result in a patch (the code change itself is probably a
one-liner setenv(), but we'd want documentation, tests, etc).

-Peff

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-06  1:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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).