Re: run pgindent on a regular basis / scripted manner

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Noah Misch <noah(at)leadboat(dot)com>, Jelte Fennema <postgres(at)jeltef(dot)nl>, 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
Subject: Re: run pgindent on a regular basis / scripted manner
Date: 2023-02-07 13:17:49
Message-ID: f5d803a3-fd0d-0826-250e-350d9f9c3ff0@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 2023-02-06 Mo 09:40, Robert Haas wrote:
> 2. I'd like an easy way to indent the unstaged files in the current
> directory (e.g. pgindent --dirty) or the files that have been queued
> up for commit (e.g. pgindent --cached).
>

My git-fu is probably not all that it should be. I think we could
possibly get at this list of files by running

  git status --porcelain --untracked-files=no --ignored=no -- .

And then your --dirty list would be lines beginning with ' M' while your
--cached list would be lines beginning with 'A[ M]'

Does that seem plausible?

cheers

andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-02-07 13:33:33 Re: run pgindent on a regular basis / scripted manner
Previous Message torikoshia 2023-02-07 13:02:00 Allow auto_explain to log plan duration and buffer usage