Re: Run pgindent now? - Mailing list pgsql-hackers

From Garick Hamlin
Subject Re: Run pgindent now?
Date
Msg-id 20150527135420.GA9065@isc.upenn.edu
Whole thread Raw
In response to Re: Run pgindent now?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List pgsql-hackers
On Tue, May 26, 2015 at 04:32:42PM -0300, Alvaro Herrera wrote:
> Robert Haas wrote:
> 
> > But every time we pgindent, especially with slightly different
> > settings, we cause tools like 'git blame' to return less useful
> > answers.  And that sucks.
> 
> I've wondered a few times whether there's a way to make pgindent commits
> "transparent" to git blame, i.e. blame their modified lines to whatever
> commits modified them immediately before.

I wonder if it might be a good idea to separate whitespace changes within
a line from line breaks changes.

You could do something like a script (it could be used as a git hook) that
only enforces or warns about line-break style rules (which are easier to get
right, I think), and have a mode of pgindent that only changes whitespace 
within a line and warns about line break style problems.  So an author could
be more or less on the hook to have acceptable line-breaks and fix that on
their end and intra-line spacing could be fixed en mass with little impact.

I can't figure out how painful this would be in practice.

It's probably not worth it....

Garick




pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)
Next
From: Alvaro Herrera
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.