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 1pqJdx-0007RG-B9 for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2023 20:15:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqJdv-0008Jt-BD for pgsql-hackers@arkaria.postgresql.org; Sat, 22 Apr 2023 20:15:35 +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 1pqJdv-0008Jk-1L for pgsql-hackers@lists.postgresql.org; Sat, 22 Apr 2023 20:15:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pqJds-001K4g-HP for pgsql-hackers@postgresql.org; Sat, 22 Apr 2023 20:15:33 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 33MKFN7Z3713261; Sat, 22 Apr 2023 16:15:23 -0400 From: Tom Lane To: Noah Misch cc: Magnus Hagander , Peter Eisentraut , Andres Freund , Bruce Momjian , Jelte Fennema , Peter Geoghegan , Alvaro Herrera , Stephen Frost , Jesse Zhang , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: <20230422195906.GB1708514@rfd.leadboat.com> References: <20230129010603.GA1677550@rfd.leadboat.com> <20230202062838.GA1832088@rfd.leadboat.com> <1477791.1675320029@sss.pgh.pa.us> <764a8f96-58c3-361d-428f-7ef827d62023@enterprisedb.com> <20230206212157.axnz62oagvycvcjm@awork3.anarazel.de> <2828975.1675719367@sss.pgh.pa.us> <20230207044324.GB2017197@rfd.leadboat.com> <20230422195906.GB1708514@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Sat, 22 Apr 2023 12:59:06 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3713259.1682194523.1@sss.pgh.pa.us> Date: Sat, 22 Apr 2023 16:15:23 -0400 Message-ID: <3713260.1682194523@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Noah Misch writes: > - skip if the break-glass "pgindent: no" appears in a commit message There are two things that bother me about putting this functionality into a server hook, beyond the possible speed issue: * The risk of failure. I don't have a terribly difficult time imagining situations where things get sufficiently wedged that the server accepts *no* commits, not even ones fixing the problem. An override such as you suggest here could assuage that fear, perhaps. * The lack of user-friendliness. AFAIK, if a pre-receive hook fails you learn little except that it failed. This could be extremely frustrating to debug, especially in a situation where your local pgindent is giving you different results than the server gets. The idea of a buildfarm animal failing if --show-diff isn't empty is attractive to me mainly because it is far nicer from the debuggability standpoint. Maybe, after we get some amount of experience with trying to keep things always indent-clean, we will decide that it's reliable enough to enforce in a server hook. I think going for that right away is sheer folly though. regards, tom lane