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

Proposal: server-advertised config options

From
Drew DeVault <sir@cmpwn.com>
Date
Sep 7, 2020, 16:52 UTC
Message-ID
<C5HAJYI9RDPU.1CPN4E1JCQCAQ@homura>

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

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. Additionally, there would be a config option which white-lists a list of config options which are automatically agreed to without prompting, 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?

Next: Christian Couder
Message 1 of 9 in “Proposal: server-advertised config options”
  1. Drew DeVaultSep 7, 2020
  2. Christian CouderSep 7, 2020
  3. Drew DeVaultSep 7, 2020
  4. Junio C HamanoSep 7, 2020
  5. Drew DeVaultSep 7, 2020
  6. brian m. carlsonSep 7, 2020
  7. Drew DeVaultSep 8, 2020
  8. brian m. carlsonSep 10, 2020
  9. Junio C HamanoSep 10, 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.