Re: Run pgindent now?

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: 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-19 13:52:41
Message-ID: CA+TgmoaT_Lrjj=Tvdx9snWXorazzMUOa-wJcaBO2w5YC1hW2Jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, May 18, 2015 at 6:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> I am personally not excited about that. I would rather leave the
>> back-branches alone.
>
> It would be awfully nice though if we didn't have to deal with random
> cross-branch indenting differences. I've lost, maybe not years off my
> life, but certainly weeks of not-very-pleasant make-work because of that.
> I'm surprised you've not had the same experience.

Well, there are a couple of things that worry me:

- People rely on us to ship, in minor releases, only critical security
and stability fixes. Re-indenting the code is neither, and people may
not appreciate needless whitespace differences being shipped in the
next branch. Anyone who diffs that tarball against the previous one
is going to see a bunch of stuff in there that may make them nervous.

- If pgindent doesn't handle every branch in exactly the same way,
it's possible that this change could exacerbate differences instead of
reducing them. I actually think this is quite a likely outcome.

I personally have not found back-patching to have been significantly
complicated by whitespace differences. There are certainly code
differences that can make it quite miserable in some cases, but I
cannot recall a case where there was an issue of this time due to
erratic indenting in one branch that had meanwhile been fixed in
another branch. I accept that your experience may be different, of
course.

> Would it alleviate your concern any if we eased into this, like say only
> apply the back-branch pgindent run to 9.5 and later branches? Then at
> least I could foresee the end of that particular annoyance.

If we do this only beginning with 9.5, and if we can make the output
100% consistent across branches, and if we run it before EVERY minor
release so that people don't see unrelated diffs between consecutive
tarballs, then it would address my concerns.

I wish that pgident could be made more automated, like by having it
fully built into the tree so that you can type 'make indent', or by
having a daemon that would automatically pgindent the main tree
periodically (say, once a month, or when more than X number of
lines/files have changed, whichever comes first). I still find it
quite a hassle to set up and run.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Arjen Nienhuis 2015-05-19 13:57:02 Re: Patch for bug #12845 (GB18030 encoding)
Previous Message Marko Tiikkaja 2015-05-19 13:14:18 Re: Per row status during INSERT .. ON CONFLICT UPDATE?