mbox series

[0/4] Support server option from configuration

Message ID pull.1776.git.git.1725279236.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series Support server option from configuration | expand

Message

John Cai via GitGitGadget Sept. 2, 2024, 12:13 p.m. UTC
Currently, server options for Git protocol v2 can only be specified via the
command line option "--server-option ", which is inconvenient for users who
want to specify a list of default options.

This patch series introduces a new multi-valued configuration,
fetch.serverOption, to specify default server options. Designed similarly to
push.pushOption:

 1. Server options set in lower-priority configuration files (e.g.,
    /etc/gitconfig or $HOME/.gitconfig) can be overridden or unset in more
    specific repository configurations using an empty string.
 2. Command-line specified server options take precedence over those from
    the configuration.

All commands involving server options, including git-fetch, git-clone,
git-ls-remote, and git-pull, have been updated to recognize the new
configuration.

Xing Xin (4):
  transport: add parse_transport_option() method
  builtin/fetch.c: add fetch.serverOption configuration
  builtin/clone.c: recognize fetch.serverOption configuration
  builtin/ls-remote.c: recognize fetch.serverOption configuration

 Documentation/config/fetch.txt  | 29 ++++++++++
 Documentation/fetch-options.txt |  3 ++
 Documentation/git-clone.txt     |  3 ++
 Documentation/git-ls-remote.txt |  3 ++
 builtin/clone.c                 | 22 +++++---
 builtin/fetch.c                 | 31 ++++++++---
 builtin/ls-remote.c             | 32 ++++++++++--
 builtin/push.c                  |  6 +--
 t/t5702-protocol-v2.sh          | 93 ++++++++++++++++++++++++++++-----
 transport.c                     |  8 +++
 transport.h                     |  3 ++
 11 files changed, 196 insertions(+), 37 deletions(-)


base-commit: 4590f2e9412378c61eac95966709c78766d326ba
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1776%2Fblanet%2Fxx%2Fadd-server-option-from-config-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1776/blanet/xx/add-server-option-from-config-v1
Pull-Request: https://github.com/git/git/pull/1776

Comments

Patrick Steinhardt Sept. 3, 2024, 10:09 a.m. UTC | #1
On Mon, Sep 02, 2024 at 12:13:52PM +0000, blanet via GitGitGadget wrote:
> Currently, server options for Git protocol v2 can only be specified via the
> command line option "--server-option ", which is inconvenient for users who
> want to specify a list of default options.
> 
> This patch series introduces a new multi-valued configuration,
> fetch.serverOption, to specify default server options. Designed similarly to
> push.pushOption:
> 
>  1. Server options set in lower-priority configuration files (e.g.,
>     /etc/gitconfig or $HOME/.gitconfig) can be overridden or unset in more
>     specific repository configurations using an empty string.
>  2. Command-line specified server options take precedence over those from
>     the configuration.
> 
> All commands involving server options, including git-fetch, git-clone,
> git-ls-remote, and git-pull, have been updated to recognize the new
> configuration.

It would be nice to learn about the context this comes from. In which
scenario does it make sense to specify options by default? What is the
intended usecase? I'm sure that this feature proposal comes from a
specific usecase that you have at your employer, so learning a bit about
it would help to decide whether it makes sense to have or not.

Patrick