pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Dilger <mark.dilger@enterprisedb.com>
To: David Fetter <david@fetter.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: pgsql-committers <pgsql-committers@lists.postgresql.org>
Subject: Re: pgsql: Add a non-strict version of jsonb_set
Date: Sun, 19 Jan 2020 13:12:58 -0800
Message-ID: <6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com> (raw)
In-Reply-To: <20200119202022.GO32763@fetter.org>
References: <21806.1579227259@sss.pgh.pa.us>
	<BFF9ACE6-E9D0-4222-B6B6-CBC7728AE7EC@dunslane.net>
	<CAA8=A79P1E727WU2L27Dx7LardkxjJAecCc0gBmj-hzWtdthpg@mail.gmail.com>
	<30906.1579304462@sss.pgh.pa.us>
	<20200119173545.GA30971@fetter.org>
	<18654.1579455979@sss.pgh.pa.us>
	<20200119202022.GO32763@fetter.org>



> On Jan 19, 2020, at 12:20 PM, David Fetter <david@fetter.org> wrote:
> 
> On Sun, Jan 19, 2020 at 12:46:19PM -0500, Tom Lane wrote:
>> David Fetter <david@fetter.org> writes:
>>> On Fri, Jan 17, 2020 at 06:41:02PM -0500, Tom Lane wrote:
>>>> I'd be okay with a hook that there was a way to override ("yes,
>>>> I know what I'm doing, this doesn't require a catversion change").
>>>> But there's no way to do that is there?
>> 
>>> I'm pretty sure there is. The program called by the commit hook can
>>> prompt the user for input.
>> 
>> ... um, but the commit hook in question would run on the repo server.
>> Is there really something in the git protocol that would allow sending
>> this sort of interaction back to the person running "git push"?
> 
> According to the folks I consulted, that would require special magic
> on the client side.
> 
> How about something that sent an email or otherwise signaled the
> person pushing that this situation obtained? It's not ideal, but it's
> centralized, so harder to get inconsistent.
> 
>> I think you are right that individual committers could set up such hooks
>> in their own private repos.  But that's not what was being suggested,
>> or so I thought.
> 
> Distributing the problem by asking people to have those hooks on their
> private repo seems like a suboptimal move. Change dev boxes, and watch
> your carefully structured safeguards vanish.

I disagree.  If you have a committed directory containing hook scripts, and
a script in src/tools that can instantiate the hooks of your choosing in your
development repository, then client-side hooks can be shared between
developers without forcing any developer to use any particular hook.  I
have been annoyed in the past that .git/hooks is not itself under version
control, so shared hook scripts need to go elsewhere for versioning, and be
optionally copied to .git/hooks by some new tool, say src/tools/make_hooks.   

Client side hooks of this kind could be useful for developers without
community commit privileges, since local repository commits could also be
rejected, perhaps with an “are you sure” type override option, and more
than a catversion checking hook would be possible.

I have wanted a hook to check code indentation [1], and not all developers
agreed it would be useful enough to be worth the pain of rejecting commits.
If it were a client side hook, and had “are you sure” logic rather than
rejecting the commit unconditionally, it might be more popular.  Either way,
each developer could opt-in or opt-out as they like when running make_hooks.

Does anybody object to this idea in principle?  If not, I can put something
like this together from a similar script I already have lying around.


[1] https://www.postgresql.org/message-id/7825.1511902037%40sss.pgh.pa.us

—
Mark Dilger
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company








view thread (18+ messages)  latest in thread

Message-ID: <6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com>
Permalink:  ../6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com/
Also on:    postgresql.org/message-id/6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com

 · 

reply

Reply instructions:

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

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: mark.dilger@enterprisedb.com, david@fetter.org, tgl@sss.pgh.pa.us, andrew.dunstan@2ndquadrant.com, andrew@dunslane.net
  Subject: Re: pgsql: Add a non-strict version of jsonb_set
  In-Reply-To: <6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com>
  References: <21806.1579227259@sss.pgh.pa.us> <BFF9ACE6-E9D0-4222-B6B6-CBC7728AE7EC@dunslane.net> <CAA8=A79P1E727WU2L27Dx7LardkxjJAecCc0gBmj-hzWtdthpg@mail.gmail.com> <30906.1579304462@sss.pgh.pa.us> <20200119173545.GA30971@fetter.org> <18654.1579455979@sss.pgh.pa.us> <20200119202022.GO32763@fetter.org> <6F023748-BBBD-45EE-9119-E2718AD1D73A@enterprisedb.com>

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

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox