From: Tom Lane <tgl@sss.pgh.pa.us>
To: Noah Misch <noah@leadboat.com>
Cc: Magnus Hagander <magnus@hagander.net>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Jelte Fennema <postgres@jeltef.nl>
Cc: Peter Geoghegan <pg@bowt.ie>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Jesse Zhang <sbjesse@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: run pgindent on a regular basis / scripted manner
Date: Sat, 22 Apr 2023 16:15:23 -0400
Message-ID: <3713260.1682194523@sss.pgh.pa.us> (raw)
In-Reply-To: <20230422195906.GB1708514@rfd.leadboat.com>
References: <Y9ArogF7c+UgPgq9@momjian.us>
<20230129010603.GA1677550@rfd.leadboat.com>
<Y9groc0Nyy7SOROy@momjian.us>
<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>
<CABUevEzdOYU2WFu=Hj+F4mkZV-TxLyS1d+azo4cMB3fSN7r37w@mail.gmail.com>
<20230422195906.GB1708514@rfd.leadboat.com>
Noah Misch <noah@leadboat.com> 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
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, noah@leadboat.com, magnus@hagander.net, peter.eisentraut@enterprisedb.com, andres@anarazel.de, bruce@momjian.us, postgres@jeltef.nl, pg@bowt.ie, alvherre@2ndquadrant.com, sfrost@snowman.net, sbjesse@gmail.com
Subject: Re: run pgindent on a regular basis / scripted manner
In-Reply-To: <3713260.1682194523@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