From: Noah Misch <noah@leadboat.com>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Andrew Dunstan <andrew@dunslane.net>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jelte Fennema <postgres@jeltef.nl>
Cc: shiy.fnst@fujitsu.com, Robert Haas <robertmhaas@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
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: Jesse Zhang <sbjesse@gmail.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: run pgindent on a regular basis / scripted manner
Date: Wed, 15 Feb 2023 20:34:04 -0800
Message-ID: <20230216043404.GA2385625@rfd.leadboat.com> (raw)
In-Reply-To: <20230215184552.GS1653@telsasoft.com>
References: <CAGECzQSUYmfTwEWcVfwb4d=vf=M7RYJjq6ie0YPTUhP+YFcEww@mail.gmail.com>
<1d66447e-a77b-ca0d-90a0-782800e85383@dunslane.net>
<TYAPR01MB6315B86619944D4A6B56842DFDDE9@TYAPR01MB6315.jpnprd01.prod.outlook.com>
<CAGECzQT44xN-zcTQ0+OxLpWa9nONxmEaYxQpaWM+My+A4o72PA@mail.gmail.com>
<390e7b04-11f3-f715-7a7d-d1a9077fbea8@dunslane.net>
<00885533-!ff96-2a95-7911-329c873b3029@dunslane.net>
<842819.1676219054@sss.pgh.pa.us>
<20230212205936.GV1653@telsasoft.com>
<2701ad84-05c9-6381-1666-b874c3000d54@dunslane.net>
<20230215184552.GS1653@telsasoft.com>
On Wed, Feb 15, 2023 at 12:45:52PM -0600, Justin Pryzby wrote:
> On Mon, Feb 13, 2023 at 07:57:25AM -0500, Andrew Dunstan wrote:
> > On 2023-02-12 Su 15:59, Justin Pryzby wrote:
> > > It seems like if pgindent knows about git, it ought to process only
> > > tracked files. Then, it wouldn't need to manually exclude generated
> > > files, and it wouldn't process vpath builds and who-knows-what else it
> > > finds in CWD.
> >
> > I don't really want restrict this to tracked files because it would mean you
> > can't pgindent files before you `git add` them.
>
> I think you'd allow indenting files which were either tracked *or*
> specified on the command line.
>
> Also, it makes a more sense to "add" the file before indenting it, to
> allow checking the output and remove unrelated changes. So that doesn't
> seem to me like a restriction of any significance.
>
> But I would never want to indent an untracked file unless I specified
> it.
Agreed. I use pgindent three ways:
1. Indent everything that changed between master and the current branch. Most
common, since I develop nontrivial patches on branches.
2. Indent all staged files. For trivial changes.
3. Indent all tracked files. For typedefs.list changes.
That said, pre-2023 pgindent changed untracked files if called without a file
list. I've lived with that and could continue to do so.
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: noah@leadboat.com, pryzby@telsasoft.com, andrew@dunslane.net, tgl@sss.pgh.pa.us, postgres@jeltef.nl, robertmhaas@gmail.com, andres@anarazel.de, pg@bowt.ie, bruce@momjian.us, magnus@hagander.net, alvherre@2ndquadrant.com, sfrost@snowman.net, sbjesse@gmail.com
Subject: Re: run pgindent on a regular basis / scripted manner
In-Reply-To: <20230216043404.GA2385625@rfd.leadboat.com>
* 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