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

Re: [PATCH 2/2] send-pack: downgrade push options error to warning

From
Jeff King <peff@peff.net>
Date
Feb 18, 2020, 05:40 UTC
Message-ID
<20200218054009.GD1641086@coredump.intra.peff.net>
In-Reply-To
<20200217144432.43920-2-sir@cmpwn.com>
On Mon, Feb 17, 2020 at 09:44:32AM -0500, Drew DeVault wrote:
> Because the receiving end has to explicitly enable
> receive.advertisePushOptions, and many servers don't, it doesn't make
> sense to set push options globally when half of your pushes are just
> going to die.

This makes me a little nervous, because we don't know what those push options were supposed to do. Yet we'll proceed with the push minus the options, which might perform an action that it's hard for the user to undo. Imagine something as harmless as an option to suppress notifications to your teammates about a push, or something as dangerous as one that changes how the push will do an auto-deploy to a production service.

That latter is probably unlikely, but it feels like we ought to be erring on the conservative side here, especially since we've had the old behavior for so many versions.

I do agree that setting push.pushOptions in your global gitconfig is probably going to be annoying. Even in the repo .git/config, you might push to multiple remotes, only some of which support the options.

So perhaps it would make sense to do one or both of:
 - allow remote.*.pushOptions for specific remotes
 - add a push.pushOptionIfAble key which behaves similarly to
   push.pushOption, but is quietly ignored if options aren't supported.
   Then you could put options there that you know are safe to be
   ignored.

I'm not sure exactly what kinds of options you want be setting globally, so I'm not sure which of those would be more useful.

-Peff
Previous: Drew DeVaultNext: Junio C Hamano
Message 3 of 5 in “git-receive-pack: document push options”
  1. 1/2 git-receive-pack: document push optionsDrew DeVault, Feb 17, 2020
  2. 2/2 send-pack: downgrade push options error to warningDrew DeVault, Feb 17, 2020
  3. Jeff KingFeb 18, 2020
  4. Junio C HamanoFeb 18, 2020
  5. Jeff KingFeb 18, 2020

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.