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

Re: [RFC/PATCH] push: deny policy to prevent pushes to unwanted remotes.

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 6, 2016, 16:13 UTC
Message-ID
<xmqq7fe2z45p.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<vpq37oqjqgn.fsf@anie.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 21 quoted lines
> Antoine Queru <Antoine.Queru@grenoble-inp.org> writes:
>
>> Currently, a user wanting to prevent accidental pushes to the wrong
>> remote has to create a pre-push hook.  The feature
>
> It's not clear what "The feature" refers to. Given the context, I read
> it as "pre-push hook", but I think this is not what you meant.
>
>> User, password and port are not treated. Should it be ?
>
> Please elaborate on "not treated". What happens if github.com is
> blacklisted by the user pushes to http://me@github.com ?
> ...
>> +remote.pushBlacklist::
>> +	The list of remotes the user is forbidden to push to.
>> +	See linkgit:git-push[1]
>
> This is only true when remote.pushDefaultPolicy is "allow". It makes
> sense to say it explicitly here, if only to have a pointer to
> pushDefaultPolicy.
> ...

All good comments and suggestions, but I am bothered a lot more by this being called "Policy" and uses words like "Prevent" and "Forbidden" as if there is a real enforcement mechanism, when in reality what is proposed is only advisory.

It is a good design balance to leave such a client-side mechanism advisory and go no further than that; a truly draconian client side mechanism has no value, as the Git protocol is open, well documented and you can write and use a more liberal client to work around such a mechanism. I do not think selling such an advisory mechanism as if it is a policy enforcement feature.

"user wanting to avoid accidental pushes" the log message mentions sets the expectation at the right level, I would think. I do not think this is about a "Policy enforcement"; where its value lies in is accident prevention (and possibly self discipline enforcement).

Previous: Matthieu MoyNext: Matthieu Moy
Message 9 of 10 in “push: deny policy to prevent pushes to unwanted remotes.”
  1. push: deny policy to prevent pushes to unwanted remotes.Antoine Queru, Jun 4, 2016
  2. Remi Galan AlfonsoJun 6, 2016
  3. Antoine QueruJun 6, 2016
  4. Lars SchneiderJun 15, 2016
  5. Antoine QueruJun 20, 2016
  6. Matthieu MoyJun 21, 2016
  7. Lars SchneiderJun 21, 2016
  8. Matthieu MoyJun 6, 2016
  9. Junio C HamanoJun 6, 2016
  10. Matthieu MoyJun 6, 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.