Re: run pgindent on a regular basis / scripted manner - Mailing list pgsql-hackers

From Robert Haas
Subject Re: run pgindent on a regular basis / scripted manner
Date
Msg-id CA+TgmobWzN_P3WCdDR-sO9EzVWMFice8oViVCFUW+0T0mXiZKg@mail.gmail.com
Whole thread Raw
In response to Re: run pgindent on a regular basis / scripted manner  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: run pgindent on a regular basis / scripted manner
List pgsql-hackers
On Tue, Feb 7, 2023 at 8:17 AM Andrew Dunstan <andrew@dunslane.net> wrote:
> 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?

I don't know if that works or not, but it does seem plausible, at
least. My idea would have been to use the --name-status option, which
works for both git diff and git show. You just look and see which
lines in the output start with M or A and then take the file names
from those lines.

So to indent files that are dirty, you would look at:

git diff --name-status

For what's cached:

git diff --name-status --cached

For the combination of the two:

git diff --name-status HEAD

For a prior commit:

git show --name-status $COMMITID

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Exit walsender before confirming remote flush in logical replication
Next
From: Andrey Borodin
Date:
Subject: Re: Too coarse predicate locks granularity for B+ tree indexes