git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Christian Couder <christian.couder@gmail.com>
To: Drew DeVault <sir@cmpwn.com>
Cc: git <git@vger.kernel.org>
Subject: Re: Proposal: server-advertised config options
Date: Mon, 7 Sep 2020 20:49:03 +0200	[thread overview]
Message-ID: <CAP8UFD1wS9GDhek0Rbo=E+csf_u32D+22EsLom=AFu5D1pAYYg@mail.gmail.com> (raw)
In-Reply-To: <C5HAJYI9RDPU.1CPN4E1JCQCAQ@homura>

On Mon, Sep 7, 2020 at 7:06 PM Drew DeVault <sir@cmpwn.com> wrote:
>
> The basic idea is that the server could advertise some config options
> which it recommends the client sets for a given repo after a fetch. Some
> possible use-cases for this feature include setting:
>
> - format.subjectPrefix to 'PATCH my-project'
> - sendemail.to to the mailing list address
> - push.pushOption to recommended push options

It could be useful to suggest promisor/partial clone remote config options too.

> Upon cloning, each recommended config option would be displayed to the
> user, and they would be prompted ([Y/n]) to agree to set that value in
> the config file for that repository.

Maybe the default should be "N" instead of "Y" for more security. Also
when not using a terminal, it should do nothing by default too.

> Additionally, there would be a
> config option which white-lists a list of config options which are
> automatically agreed to without prompting,

This might be dangerous if this option can also be proposed by the
server, as it could first propose a big list of white listed options
to the client.

> and each config option would
> have one of the following states:
>
> - accept-silent: set the option without printing a message
> - accept-verbose: set the option and display a message
> - prompt: prompt the user to set this config option
> - reject-silent: silently refuse to set this config option
> - reject-verbose: refuse to set this config option and display a message
>
> We would default to reject-verbose for all unknown config options and
> include a set of defaults which specifies the appropriate trust level
> for various useful benign options (such as the examples above).
>
> The implementation would involve advertising config-advertisement in the
> fetch protocol. Both the client and server would have to agree to use
> it. If the server supports it but the client does not (in the case of an
> old client), it could fall back to printing the list of recommended
> options to stderr.
>
> To choose which config options to advertise, a new option would be
> introduced (uploadpack.advertiseOptions) for example, which has a list
> of .git/config options from the remote repository to forward to the
> client.
>
> This would be a lot of work so I'd like to float it for discussion
> before getting started. What do you guys think?

My opinion is that you might not want to start working on all the
above at once. It might be better to start small and safe while
leaving the door open to further improvements.

  reply	other threads:[~2020-09-07 18:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07 16:52 Proposal: server-advertised config options Drew DeVault
2020-09-07 18:49 ` Christian Couder [this message]
2020-09-07 18:49   ` Drew DeVault
2020-09-07 18:51 ` Junio C Hamano
2020-09-07 19:23   ` Drew DeVault
2020-09-07 20:52     ` brian m. carlson
2020-09-08 14:14       ` Drew DeVault
2020-09-10  1:45         ` brian m. carlson
2020-09-10  4:27           ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP8UFD1wS9GDhek0Rbo=E+csf_u32D+22EsLom=AFu5D1pAYYg@mail.gmail.com' \
    --to=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=sir@cmpwn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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