Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pP57K-0004zT-7B for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Feb 2023 17:17:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pP57I-0007al-6r for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Feb 2023 17:17:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pP57H-0007ac-55 for pgsql-hackers@lists.postgresql.org; Mon, 06 Feb 2023 17:17:19 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pP579-00088j-JR for pgsql-hackers@postgresql.org; Mon, 06 Feb 2023 17:17:18 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id A469E581FC8; Mon, 6 Feb 2023 12:17:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 06 Feb 2023 12:17:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1675703829; x= 1675711029; bh=OLeJAPLz0Lef5RxTsnVSK9c4to/nfOMKSk4P6DfNRPc=; b=D xC2hXVw46Rp/XVF5b/dqlBdLIzhzLx7Jn3Tv/b3/BJQHUTb61MVfgPEUivJofsDJ x1DvKHFfKgPcOgKhyqFjN0aSSw78YqDMQwrlMAMnlno225tdETtxkcUWYUmNVFls 54n+zieUVaFXS8QRk2+mnoGk5uZ/55vN8oTh1xGyZD57ZdM/6Vuxurw6jT2k0a50 x/sj6oogttSeqmLIy1Fuv0YRwJtAtKZlc1D5iwjF00PbWuRAOVG7VNaWWnI2u1NL GGCTZcnc8vq3gB8rlsqwiwIQ2fi8zKIdMC0m0bF417EPpvlisxfJky7ohU20vnH2 ZJzJEQEDJXgjoJ75H/TkA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudegiedgleehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvghnth gvrhhprhhishgvuggsrdgtohhmqeenucggtffrrghtthgvrhhnpeehleffgeegudejteei hfelteduvdeifffhffdvjedvffegjeekudeludehudeifeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrrdgvihhsvghnthhrrghu thesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Feedback-ID: i131946ab:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Feb 2023 12:17:07 -0500 (EST) Message-ID: <764a8f96-58c3-361d-428f-7ef827d62023@enterprisedb.com> Date: Mon, 6 Feb 2023 18:17:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: run pgindent on a regular basis / scripted manner Content-Language: en-US To: Tom Lane , Noah Misch Cc: Bruce Momjian , Jelte Fennema , Andres Freund , Peter Geoghegan , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , PostgreSQL-development References: <20230123011002.fzcaa3krql3mqsfn@awork3.anarazel.de> <1509591.1674437376@sss.pgh.pa.us> <1608158.1674486546@sss.pgh.pa.us> <20230123173136.knn77pbuakhvjfgk@awork3.anarazel.de> <2238493.1674572097@sss.pgh.pa.us> <20230129010603.GA1677550@rfd.leadboat.com> <20230202062838.GA1832088@rfd.leadboat.com> <1477791.1675320029@sss.pgh.pa.us> From: Peter Eisentraut In-Reply-To: <1477791.1675320029@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 02.02.23 07:40, Tom Lane wrote: > Noah Misch writes: >> Regarding the concern about a pre-receive hook blocking an emergency push, the >> hook could approve every push where a string like "pgindent: no" appears in a >> commit message within the push. You'd still want to make the tree clean >> sometime the same week or so. It's cheap to provide a break-glass like that. > > I think the real question here is whether we can get all (or at least > a solid majority of) committers to accept such draconian constraints. > I'd buy into it, and evidently so would you, but I can't help noting > that less than a quarter of active committers have bothered to > comment on this thread. I suspect the other three-quarters would > be quite annoyed if we tried to institute such requirements. That's > not manpower we can afford to drive away. I have some concerns about this. First, as a matter of principle, it would introduce another level of gatekeeping power. Right now, the committers are as a group in charge of what gets into the tree. Adding commit hooks that are installed somewhere(?) by someone(?) and can only be seen by some(?) would upset that. If we were using something like github or gitlab (not suggesting that, but for illustration), then you could put this kind of thing under .github/ or similar and then it would be under the same control as the source code itself. Also, pgindent takes tens of seconds to run, so hooking that into the git push process would slow this down quite a bit. And maybe we want to add pgperltidy and so on, where would this lead? If somehow your local indenting doesn't give you the "correct" result for some reason, you might sit there for minutes and minutes trying to fix and push and fix and push. Then, consider the typedefs issue. If you add a typedef but don't add it to the typedefs list but otherwise pgindent your code perfectly, the push would be accepted. If then later someone updates the typedefs list, perhaps from the build farm, it would then reject the indentation of your previously committed code, thus making it their problem. I think a better way to address these issues would be making this into a test suite, so that you can run some command that checks "is everything indented correctly". Then you can run this locally, on the build farm, in the cfbot etc. in a uniform way and apply the existing blaming/encouragement processes like for any other test failure.