From: Jeff King Date: Tue, 18 Feb 2020 20:59:06 GMT Subject: Re: [PATCH v2] push: introduce --push-option-if-able Message-ID: <20200218205906.GB22630@coredump.intra.peff.net> In-Reply-To: <20200218200913.128519-1-sir@cmpwn.com> On Tue, Feb 18, 2020 at 03:09:14PM -0500, Drew DeVault wrote: > This introduces a --push-option-if-able, and along with it updates > send-pack, transport, push, etc to track the list of push options > specified via this flag. These options will be used if the remote > supports push options, but will not cause the push operation to > terminate if the remote does not support push options. > > This is desirable in the following scenario: you frequently use two git > hosts, A and B, of which only B supports push options. If you wish to > set a push option globally (via git config push.pushOptions), any > attempts to push to host A will fail, requiring you to explicitly > override it at the command line. This renders the push.pushOption > config value basically useless for a lot of users. Unsurprisingly, this approach makes sense to me. :) The implementation looks like the right direction, but I noticed a few things I think are worth addressing: > Documentation/config/push.txt | 6 +++++ > Documentation/git-push.txt | 14 +++++++++++- > Documentation/git-receive-pack.txt | 10 +++++++++ > Documentation/githooks.txt | 3 ++- > builtin/push.c | 35 +++++++++++++++++++++++++----- > send-pack.c | 9 ++++++-- > send-pack.h | 2 +- > submodule.c | 11 +++++++++- > submodule.h | 1 + > transport-helper.c | 3 +++ > transport.c | 2 ++ > transport.h | 5 +++++ We'd probably want some test coverage of the new command-line and config options. Looks like t/t5545-push-options.sh would be a good place to add it, and you should be able to emulate some of the existing tests there. > @@ -224,6 +225,17 @@ already exists on the remote side. > line, the values of configuration variable `push.pushOption` > are used instead. > > +--push-option-if-able=