Re: run pgindent on a regular basis / scripted manner

From: Jelte Fennema <postgres(at)jeltef(dot)nl>
To: "shiy(dot)fnst(at)fujitsu(dot)com" <shiy(dot)fnst(at)fujitsu(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Noah Misch <noah(at)leadboat(dot)com>, Peter Geoghegan <pg(at)bowt(dot)ie>, Bruce Momjian <bruce(at)momjian(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Stephen Frost <sfrost(at)snowman(dot)net>, Jesse Zhang <sbjesse(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: run pgindent on a regular basis / scripted manner
Date: 2023-02-10 09:25:44
Message-ID: CAGECzQT44xN-zcTQ0+OxLpWa9nONxmEaYxQpaWM+My+A4o72PA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Ah yes, I had seen that when I read the initial --commit patch but
then forgot about it when the flag didn't work at all when I tried it.

Attached is a patch that fixes the issue. And also implements the
--dirty and --staged flags in pgindent that Robert Haas requested.

On Fri, 10 Feb 2023 at 03:37, shiy(dot)fnst(at)fujitsu(dot)com
<shiy(dot)fnst(at)fujitsu(dot)com> wrote:
>
> On Thu, Feb 9, 2023 6:10 AM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> > Thanks, I have committed this. Still looking at Robert's other request.
> >
>
> Hi,
>
> I tried the new option --commit and found that it seems to try to indent files
> which are deleted in the specified commit and reports an error.
>
> cannot open file "src/backend/access/brin/brin.c": No such file or directory
>
> It looks we should filter such files.
>
> Regards,
> Shi Yu

Attachment Content-Type Size
0001-Fix-pgindent-commit-flag-and-add-dirty-and-staged-fl.patch application/octet-stream 2.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2023-02-10 10:25:53 Re: libpq: PQgetCopyData() and allocation overhead
Previous Message Alvaro Herrera 2023-02-10 08:30:26 Re: pg_usleep for multisecond delays