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 1k64Xm-0005hs-08 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2020 04:08:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k64Xk-0007pK-VO for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2020 04:08:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k64Xk-0007pD-Oc for pgsql-hackers@lists.postgresql.org; Thu, 13 Aug 2020 04:08:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k64Xh-0000o7-MX for pgsql-hackers@postgresql.org; Thu, 13 Aug 2020 04:08:44 +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 07D48aEm397021; Thu, 13 Aug 2020 00:08:36 -0400 From: Tom Lane To: Noah Misch cc: Jesse Zhang , Andres Freund , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: <20200813035308.GA1137170@rfd.leadboat.com> References: <20200812223409.6di3y2qsnvynao7a@alap3.anarazel.de> <328084.1597276021@sss.pgh.pa.us> <20200813035308.GA1137170@rfd.leadboat.com> Comments: In-reply-to Noah Misch message dated "Wed, 12 Aug 2020 20:53:08 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <397019.1597291716.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 13 Aug 2020 00:08:36 -0400 Message-ID: <397020.1597291716@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Noah Misch writes: > On Wed, Aug 12, 2020 at 07:47:01PM -0400, Tom Lane wrote: >> If the workflow is commit first and re-indent later, then we can always >> revert the pgindent commit and clean things up manually; but an auto >> re-indent during commit wouldn't provide that history. > There are competing implementations of assuring pgindent-cleanliness at = every > check-in: > 1. After each push, an automated followup commit appears, restoring > pgindent-cleanliness. > 2. "git push" results in a commit that melds pgindent changes into what = the > committer tried to push. > 3. "git push" fails, for the master branch, if the pushed commit disrupt= s > pgindent-cleanliness. > Were you thinking of (2)? I was objecting to (2). (1) would perhaps work. (3) could be pretty darn annoying, especially if it blocks a time-critical security patch. > Regarding typedefs.list, I would use the in-tree one, like you discussed= here: Yeah, after thinking about that more, it seems like automated typedefs.list updates would be far riskier than automated reindent based on the existing typedefs.list. The latter could at least be expected not to change code unrelated to the immediate commit. typedefs.list updates need some amount of adult supervision. (I'd still vote for nag-mail to the committer whose work got reindented, in case the bot made things a lot worse.) I hadn't thought about the angle of HEAD versus back-branch patches, but that does seem like something to ponder. The back branches don't have the same pgindent rules necessarily, plus the patch versions might be different in more than just whitespace. My own habit when back-patching has been to indent the HEAD patch per-current-rules and then preserve that layout as much as possible in the back branches, but I doubt we could get a tool to do that with any reliability. Of course, there's also the possibility of forcibly reindenting all the active back branches to current rules. But I think we've rejected that idea already, because it would cause so much pain for forks that are following a back branch. regards, tom lane