{"thread":{"id":"59771","subject":"git push --quiet is not quiet","startedAt":"2023-05-19T08:20:29Z","lastAt":"2023-06-06T01:57:30Z","messageCount":7,"participants":["Hanno Böck","Kristoffer Haugsbakk","Jeff King","Taylor Blau"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"477593","messageId":"20230519101505.416d0963.hanno@hboeck.de","threadId":"59771","inReplyTo":null,"subject":"git push --quiet is not quiet","fromName":"Hanno Böck","fromEmail":"hanno@hboeck.de","sentAt":"2023-05-19T08:15:05Z","receivedAt":"2023-05-19T08:20:29Z","isPatch":false,"sender":{"key":"hanno@hboeck.de","avatar":"https://gravatar.com/avatar/79b34ab31390dbd2ca7a8550994c8b6e1ad637e77071a3a25e76d7810236369d?d=mp&s=160"},"body":"I believe this is a bug in git: According to the man page for git push,\nthe -q/--quiet parameter should \"Suppress all output\".\n\nHowever, it does not. To reproduce: Create a commit in a repo and run:\ngit push -q\nremote: Resolving deltas: 100% (1/1), completed with 1 local object.\n\n\n[System Info]\ngit version:\ngit version 2.40.1\ncpu: x86_64\nno commit associated with this build\nsizeof-long: 8\nsizeof-size_t: 8\nshell-path: /bin/sh\nuname: Linux 6.3.3 #1 SMP Thu May 18 21:38:29 CEST 2023 x86_64\ncompiler info: gnuc: 13.1\nlibc info: glibc: 2.37\n$SHELL (typically, interactive shell): /bin/bash\n\n\n-- \nHanno Böck\nhttps://hboeck.de/\n"},{"id":"477594","messageId":"de4a7ce5-f12e-46be-a897-adb36068dd47@app.fastmail.com","threadId":"59771","inReplyTo":"20230519101505.416d0963.hanno@hboeck.de","subject":"Re: git push --quiet is not quiet","fromName":"Kristoffer Haugsbakk","fromEmail":"code@khaugsbakk.name","sentAt":"2023-05-19T08:59:21Z","receivedAt":"2023-05-19T09:00:30Z","isPatch":false,"sender":{"key":"code@khaugsbakk.name","avatar":"https://avatars.githubusercontent.com/u/2229597?v=4"},"body":"Hi\n\nOn Fri, May 19, 2023, at 10:15, Hanno Böck wrote:\n> I believe this is a bug in git: According to the man page for git push,\n> the -q/--quiet parameter should \"Suppress all output\".\n\nLooks like the message is coming from the remote. If I make a fresh\nfresh commit in a fork I get this message from GitHub:\n\n```\nremote:\nremote: Create a pull request for 'test-push' on GitHub by visiting:\nremote:      https://github.com/LemmingAvalanche/git/pull/new/test-push\nremote:\n```\n\nThe delta message has the same `remote:` prefix.\n\n`git push --quiet` does keep quiet when I test it locally (i.e. no\ninterference from the forge).\n\n-- \nKristoffer Haugsbakk\n"},{"id":"477595","messageId":"20230519090559.GA3515410@coredump.intra.peff.net","threadId":"59771","inReplyTo":"20230519101505.416d0963.hanno@hboeck.de","subject":"Re: git push --quiet is not quiet","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-05-19T09:05:59Z","receivedAt":"2023-05-19T09:06:18Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 19, 2023 at 10:15:05AM +0200, Hanno Böck wrote:\n\n> I believe this is a bug in git: According to the man page for git push,\n> the -q/--quiet parameter should \"Suppress all output\".\n> \n> However, it does not. To reproduce: Create a commit in a repo and run:\n> git push -q\n> remote: Resolving deltas: 100% (1/1), completed with 1 local object.\n\nThat message is coming from the remote side over the stderr sideband; we\ndon't interpret it locally, so we don't know whether it's a real error\nor just chatter. We must pass it on to the user. So the bug is that the\nremote side is showing progress output, even though we've asked for\n--quiet.\n\nThat is usually handled by sending a \"quiet\" capability over the\nprotocol. E.g., if you do something like this:\n\n  git init --bare dst.git\n  GIT_TRACE_PACKET=1 git push dst.git HEAD\n\nYou should see the server advertise that it knows about the \"quiet\"\ncapability:\n\n  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\n\nAnd then when the client responds, it asks for \"quiet\":\n\n  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\n\nWhat is your push destination? If you run your push with GIT_TRACE_PACKET=1\nin the environment, does the other side say that it supports \"quiet\"?\n\nAs a guess, I wondered if you might be pushing to GitHub. And indeed,\nthey do not support quiet. Here's the advertisement from pushing to a\ntest repo over ssh:\n\n  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\n\nSo I think this is a bug / lack of feature in GitHub's server\nimplementation.  It used to be a thin proxy around Git (and Git has\nsupported \"quiet\" since c207e34f7733 in 2012). But I suspect they may\nhave recently replaced it with something more custom (based on the agent\nfield).\n\n+cc a few relevant GitHubbers\n\n-Peff\n"},{"id":"477597","messageId":"20230519110937.7df62fd7.hanno@hboeck.de","threadId":"59771","inReplyTo":"20230519090559.GA3515410@coredump.intra.peff.net","subject":"Re: git push --quiet is not quiet","fromName":"Hanno Böck","fromEmail":"hanno@hboeck.de","sentAt":"2023-05-19T09:09:37Z","receivedAt":"2023-05-19T09:09:46Z","isPatch":false,"sender":{"key":"hanno@hboeck.de","avatar":"https://gravatar.com/avatar/79b34ab31390dbd2ca7a8550994c8b6e1ad637e77071a3a25e76d7810236369d?d=mp&s=160"},"body":"On Fri, 19 May 2023 05:05:59 -0400\nJeff King <peff@peff.net> wrote:\n\n> As a guess, I wondered if you might be pushing to GitHub.\n\nYes.\n\n> So I think this is a bug / lack of feature in GitHub's server\n> implementation.  It used to be a thin proxy around Git (and Git has\n> supported \"quiet\" since c207e34f7733 in 2012). But I suspect they may\n> have recently replaced it with something more custom (based on the\n> agent field).\n\nOk, interesting. Maybe add to this: it appears github sometimes uses\nthis channel to send relevant messages, e.g. dependabot alerts. Which I\nguess is a good thing, but it probably shouldn't send status messages\nfor normal commits when the user asks for \"quiet\".\n\n-- \nHanno Böck\nhttps://hboeck.de/\n"},{"id":"477607","messageId":"20230519204208.GA4001861@coredump.intra.peff.net","threadId":"59771","inReplyTo":"20230519110937.7df62fd7.hanno@hboeck.de","subject":"Re: git push --quiet is not quiet","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-05-19T20:42:08Z","receivedAt":"2023-05-19T20:42:15Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Fri, May 19, 2023 at 11:09:37AM +0200, Hanno Böck wrote:\n\n> > So I think this is a bug / lack of feature in GitHub's server\n> > implementation.  It used to be a thin proxy around Git (and Git has\n> > supported \"quiet\" since c207e34f7733 in 2012). But I suspect they may\n> > have recently replaced it with something more custom (based on the\n> > agent field).\n> \n> Ok, interesting. Maybe add to this: it appears github sometimes uses\n> this channel to send relevant messages, e.g. dependabot alerts. Which I\n> guess is a good thing, but it probably shouldn't send status messages\n> for normal commits when the user asks for \"quiet\".\n\nYeah, that makes sense. Hooks should respect the \"quiet\" flag, too, as\nappropriate. But the problem here is that because the server does not\nclaim to support the \"quiet\" capability, the client is not even passing\nalong the message that the user asked for \"--quiet\".\n\nPresumably once that is fixed, the custom messages from the server would\nthen respect the quiet flag. But it's possible there might be more work\nneeded there, too.\n\n-Peff\n"},{"id":"478044","messageId":"ZH3IufbB/mJBBKsv@nand.local","threadId":"59771","inReplyTo":"20230519090559.GA3515410@coredump.intra.peff.net","subject":"Re: git push --quiet is not quiet","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2023-06-05T11:36:25Z","receivedAt":"2023-06-05T11:36:35Z","isPatch":false,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Fri, May 19, 2023 at 05:05:59AM -0400, Jeff King wrote:\n> So I think this is a bug / lack of feature in GitHub's server\n> implementation.  It used to be a thin proxy around Git (and Git has\n> supported \"quiet\" since c207e34f7733 in 2012). But I suspect they may\n> have recently replaced it with something more custom (based on the agent\n> field).\n>\n> +cc a few relevant GitHubbers\n\nSorry for missing this. Indeed, this is a missing feature from GitHub's\ncustom reimplementation of receive-pack [1]. The rollout of this new\nimplementation is relatively recent, which is probably why this wasn't\nnoticed until Hanno wrote about it.\n\nI mentioned this to the team that is working on spokes-receive-pack, and\nthey have graciously implemented support for the quiet capability here:\n\n  https://github.com/github/spokes-receive-pack/pull/49\n\nHopefully that gets merged and rolled out soon, at which point I think\nwe can call it a day here.\n\nThanks,\nTaylor\n\n[1]: https://github.com/github/spokes-receive-pack\n\n"},{"id":"478060","messageId":"20230606015721.GA89456@coredump.intra.peff.net","threadId":"59771","inReplyTo":"ZH3IufbB/mJBBKsv@nand.local","subject":"Re: git push --quiet is not quiet","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2023-06-06T01:57:21Z","receivedAt":"2023-06-06T01:57:30Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 05, 2023 at 07:36:25AM -0400, Taylor Blau wrote:\n\n> I mentioned this to the team that is working on spokes-receive-pack, and\n> they have graciously implemented support for the quiet capability here:\n> \n>   https://github.com/github/spokes-receive-pack/pull/49\n> \n> Hopefully that gets merged and rolled out soon, at which point I think\n> we can call it a day here.\n\nAh, cool, I didn't realize the implementation was open source. That pull\nrequest looks like what I'd expect (from my obviously brief look at the\ncode).\n\nI wondered that it did not pass along any kind of \"quiet\" designation to\nthe hooks (who might want to be less chatty in that case). But it\ndoesn't look like git-receive-pack does, either. So at least\nspokes-receive-pack will be on par with git.git. :)\n\nI do think it would be a potentially useful feature for receive-pack to\npass on the information that it got a \"quiet\" capability request from\nthe client (probably through the environment). But if people aren't\ncomplaining about it, it's probably not a high priority.  The only\ndiscussion I could find was this thread from a few years ago:\n\n  https://lore.kernel.org/git/ba70b25b-906c-0117-2594-c606595c6816@redhat.com/\n\nbut it didn't result in a patch (the code change itself is probably a\none-liner setenv(), but we'd want documentation, tests, etc).\n\n-Peff\n"}]}