Re: Run pgindent now?

From: Garick Hamlin <ghamlin(at)isc(dot)upenn(dot)edu>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Bruce Momjian <bruce(at)momjian(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Run pgindent now?
Date: 2015-05-27 13:54:37
Message-ID: 20150527135420.GA9065@isc.upenn.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2015-05-27 14:06:24 Re: Re: [COMMITTERS] pgsql: Add support for INSERT ... ON CONFLICT DO NOTHING/UPDATE.
Previous Message Stephen Frost 2015-05-27 13:51:55 Re: [COMMITTERS] pgsql: Row-Level Security Policies (RLS)