Re: [Opinion gathering] Git remote whitelist/blacklist
- From
Jeff King <peff@peff.net>
- Date
- May 25, 2016, 22:52 UTC
- Message-ID
- <20160525225214.GA2612@sigill.intra.peff.net>
- In-Reply-To
- <CAPc5daURo8SkbeGf0MEsp0sLzdzFfUOxptgusFr58UG9SKmDAA@mail.gmail.com>
On Tue, May 24, 2016 at 09:07:53AM -0700, Junio C Hamano wrote:
Show 13 quoted lines
> On Tue, May 24, 2016 at 5:55 AM, Matthieu Moy > <Matthieu.Moy@grenoble-inp.fr> wrote: > > So, when trying a forbidden push, Git would deny it and the only way to > > force the push would be to remove the blacklist from the config, right? > > > > Probably the sanest way to go. I thought about adding a "git push > > --force-even-if-in-blacklist" or so, but I don't think the feature > > deserves one specific option (hence add some noise in `git push -h`). > > Yeah, I agree --even-if-in-blacklist is a road to madness, but I wonder > how this is different from setting pushURL to /dev/null or something > illegal and replace that phony configuration value when you really need > to push?
That was my thought on reading this, too. In that scheme, you could do:
git -c remote.foo.pushurl=example.com:repo.git push ...
to override it. It would be nice if you could do:
git -c remote.foo.pushurl= push ...
to "unset" the push-url list and default to the regular fetch url, but this is one of those multi-value config options that would have to learn that explicitly.
I suppose one can do:
git -c remote.foo.pushurl=$(git config remote.foo.url)
but that is getting a bit long.
-Peff