From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Jelte Fennema <postgres@jeltef.nl>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Noah Misch <noah@leadboat.com>
Cc: Jesse Zhang <sbjesse@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: run pgindent on a regular basis / scripted manner
Date: Mon, 23 Jan 2023 10:09:06 -0500
Message-ID: <1608158.1674486546@sss.pgh.pa.us> (raw)
In-Reply-To: <1509591.1674437376@sss.pgh.pa.us>
References: <1097305.1674334785@sss.pgh.pa.us>
<CAH2-WzkHHcPRMj3G1b_dUfY0aR4W4OAHQ9_Z6sDGvL8Ew+aRrA@mail.gmail.com>
<20230121224312.qmwpagrebidr6hi7@awork3.anarazel.de>
<CAH2-Wzm0niYBPcN6eX3PzHABfj0dE3fwifo5bdturvMp=9FGqw@mail.gmail.com>
<20230122094957.x542ojaqgi4lalq4@awork3.anarazel.de>
<CAGECzQRYjHdNQ-Bq2yrBb-8s3Pjx7pfvYPDdNv9tcvDcscDhbg@mail.gmail.com>
<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>
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
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 using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, postgres@jeltef.nl, pg@bowt.ie, bruce@momjian.us, magnus@hagander.net, alvherre@2ndquadrant.com, sfrost@snowman.net, noah@leadboat.com, sbjesse@gmail.com
Subject: Re: run pgindent on a regular basis / scripted manner
In-Reply-To: <1608158.1674486546@sss.pgh.pa.us>
* 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