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 1pJyRq-0000J3-1r for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jan 2023 15:09:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pJyRn-00088W-Vr for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jan 2023 15:09:23 +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 1pJyRn-000881-Mf for pgsql-hackers@lists.postgresql.org; Mon, 23 Jan 2023 15:09:23 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pJyRl-0002wH-1C for pgsql-hackers@postgresql.org; Mon, 23 Jan 2023 15:09:22 +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 30NF96ca1608159; Mon, 23 Jan 2023 10:09:06 -0500 From: Tom Lane To: Andres Freund cc: Jelte Fennema , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Noah Misch , Jesse Zhang , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner In-reply-to: <1509591.1674437376@sss.pgh.pa.us> References: <1097305.1674334785@sss.pgh.pa.us> <20230121224312.qmwpagrebidr6hi7@awork3.anarazel.de> <20230122094957.x542ojaqgi4lalq4@awork3.anarazel.de> <20230122223806.3sgew6qswhsczae7@awork3.anarazel.de> <1495023.1674430107@sss.pgh.pa.us> <20230123001518.6hxyiczhn4kadvmf@awork3.anarazel.de> <1502504.1674433722@sss.pgh.pa.us> <20230123011002.fzcaa3krql3mqsfn@awork3.anarazel.de> <1509591.1674437376@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Sun, 22 Jan 2023 20:29:36 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1608157.1674486546.1@sss.pgh.pa.us> Date: Mon, 23 Jan 2023 10:09:06 -0500 Message-ID: <1608158.1674486546@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I wrote: > Cool. I'll take a look at doing this later (probably after the current > CF) unless somebody beats me to it. Thinking about that (importing pg_bsd_indent into our main source tree) a bit harder: 1. I'd originally thought vaguely that we could teach pgindent how to build pg_bsd_indent automatically. But with a little more consideration, I doubt that would work transparently. It's common (at least for me) to run pgindent in a distclean'd tree, where configure results wouldn't be available. It's even worse if you habitually use VPATH builds, so that those files *never* exist in your source tree. So now I think that we should stick to the convention that it's on the user to install pg_bsd_indent somewhere in their PATH; all we'll be doing with this change is eliminating the step of fetching pg_bsd_indent's source files from somewhere else. 2. Given #1, it'll be prudent to continue having pgindent double-check that pg_bsd_indent reports a specific version number. We could imagine starting to use the main Postgres version number for that, but I'm inclined to continue with its existing numbering series. One argument for that is that we generally change pg_bsd_indent less often than annually, so having it track the main version would end up forcing make-work builds of your installed pg_bsd_indent at least once a year. Also, when we do change pg_bsd_indent, it's typically right before a mass reindentation commit, and those do not happen at the same time as forking a new PG version. 3. If we do nothing special, the first mass reindentation is going to reformat the pg_bsd_indent sources per PG style, which is ... er ... not the way they look now. Do we want to accept that outcome, or take steps to prevent pgindent from processing pg_bsd_indent? I have a feeling that manual cleanup would be necessary if we let such reindentation happen, but I haven't experimented. regards, tom lane