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

[Opinion gathering] Git remote whitelist/blacklist

From
FBFrancois Beutin <beutinf@ensimag.grenoble-inp.fr>
Date
May 20, 2016, 14:21 UTC
Message-ID
<584027154.5608416.1463754104066.JavaMail.zimbra@ensimag.grenoble-inp.fr>
In-Reply-To
<1040142021.5607762.1463753271105.JavaMail.zimbra@ensimag.grenoble-inp.fr>
Hi everyone,

We (Ensimag students) plan to implement the "remote whitelist/blacklist" feature described in the SoC 2016 ideas, but first I would like to be sure we agree on what exactly this feature would be, and that the community sees an interest in it.

The general idea is to add a way to prevent accidental push to the
wrong repository, we see two ways to do it:
First solution:
 - a whitelist: Git will accept a push to a repository in it
 - a blacklist: Git will refuse a push to a repository in it
 - a default policy
Second solution:
 - a default policy
 - a list of repository not following the default policy
The new options in config if we implement the first solution:
[remote]
	# List of repository that will be allowed/denied with
					# a whitelist/blacklist
	whitelisted = "http://git-hosting.org"
	blacklisted = "http://git-hosting2.org"
	# What is displayed when the user attempts a push on an
		# unauthorised repository? (this option overwrites
		# the default message)
	denymessage = "message"
	# What git should do if the user attempts a push on an
		# unauthorised repository (reject or warn and
		# ask the user)?
	denypolicy = reject(default)/warning
	# How should unknown repositories be treated?
	defaultpolicy = allow(default)/deny
Some concrete usage example:
 - A beginner is working on company code, to prevent him from
	accidentally pushing the code on a public repository, the
	company (or him) can do:
git config --global remote.defaultpolicy "deny"
git config --global remote.denymessage "Not the company's server!"
git config --global remote.denypolicy "reject"
git config --global remote.whitelisted "http://company-server.com"
 - A regular git user fears that he might accidentally push sensible
	code to a public repository he often uses for free-time
	projects, he can do:
git config remote.defaultpolicy "allow"	#not really needed
git config remote.denymessage "Are you sure it is the good server?"
git config remote.denypolicy "warning"
git config remote.blacklisted "http://github/personnalproject"
We would like to gather opinions about this before starting to
	implement it, is there any controversy? Do you prefer the
	first or second solution (or none)? Do you find the option's
	names accurate?
Next: Randall S. Becker
Message 1 of 15 in “[Opinion gathering] Git remote whitelist/blacklist”
  1. Francois BeutinMay 20, 2016
  2. Randall S. BeckerMay 20, 2016
  3. Francois BeutinMay 23, 2016
  4. Francois BeutinMay 24, 2016
  5. Lars SchneiderMay 24, 2016
  6. Matthieu MoyMay 24, 2016
  7. Junio C HamanoMay 24, 2016
  8. Randall S. BeckerMay 24, 2016
  9. Junio C HamanoMay 24, 2016
  10. Lars SchneiderMay 24, 2016
  11. Randall S. BeckerMay 24, 2016
  12. Lars SchneiderMay 24, 2016
  13. Matthieu MoyMay 24, 2016
  14. Jeff KingMay 25, 2016
  15. Aaron SchrabMay 24, 2016

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.