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

From Jelte Fennema
Subject Re: run pgindent on a regular basis / scripted manner
Date
Msg-id CAGECzQTtsdX360pNP=nRoBpMcGwMK1aoYp4JgZwBMsMEKouKkQ@mail.gmail.com
Whole thread Raw
In response to Re: run pgindent on a regular basis / scripted manner  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
> (ITYM "remove as many hurdles as possible").

yes, I messed up rewriting that sentence from "having as few hurdles
as possible" to "removing as many hurdles as possible"

> So far, we have had the following categories suggested: dirty, staged, dirty+staged, untracked. Are there any
others?

The two workflows that make most sense to me personally are:
1. staged (indent anything that you're staging for a commit)
2. dirty+staged+untracked (indent anything you've been working on that
is not committed yet)

The obvious way of having --dirty, --staged, and --untracked flags
would require 3 flags for this second (to me seemingly) common
operation. That seems quite unfortunate. So I would propose the
following two flags for those purposes:
1. --staged/--cached (--cached is in line with git, but I personally
think --staged is clearer, git has --staged-only but that seems long
for no reason)
2. --uncommitted

And maybe for completeness we could have the following flags, so you
could target any combination of staged/untracked/dirty files:
3. --untracked (untracked files only)
4. --dirty (tracked files with changes that are not staged)

But I don't know in what workflow people would actually use them.

> Another issue is whether or not to restrict these to files under the current directory. I think we probably should,
orat least provide a --relative option.
 

Good point, I think it makes sense to restrict it to the current
directory by default. You can always cd to the root of the repo if you
want to format everything.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [PATCH] Add pretty-printed XML output option
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Time delayed LR (WAS Re: logical replication restrictions)