Fixes for 8.1 run of pgindent

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Fixes for 8.1 run of pgindent
Date: 2005-11-15 00:54:15
Message-ID: 200511150054.jAF0sFD13867@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > My guess is that there is a one-off bug in there.
>
> At least a two-off ... but I think it's more likely some sort of
> wrong-state error, given the narrow places where it happens. I have not
> observed any non-comment code being mis-justified, for instance.

OK, I have spent some unpleasant time tracking down the pgindent
problems from 8.1. Some were my fault, and some the BSD indent code.

First, my fault was not updating the typedefs for both /bin and /lib ---
I did only /bin. This was documented, but not clearly. I have improved
the docs on this.

Second, Tom found that when we took the margin to 79, BSD indent had a
bug that the first line after a blank comment line could go to 80 or 81
columns. I tracked down this bug and applied a fix to my version, the
patch in our CVS, and the indent tarball on our ftp server.

Third, I found that if more then 150 'else if' are used in the same
statement, the comments are shifted to start on column 100. I have
found the cause for this (stack of 150 hardcoded) and fixed that too
everywhere. I have rerun pgindent on psql/tab-complete.c and committed it
to CVS for both branches.

I have tested the new pgindent on our existing CVS and the only changes
are for comments to fix the bad wrapping, and to fix the missing /lib
typedefs.

I think we should rerun pgindent on 8.1.X and HEAD to correct the
reported problems. I am betting 90% of our patches either come from
CVS head or 8.1.X branches greater than 8.1.0.

I have on my TODO list to test GNU indent again during 8.2 to see how it
does.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-11-15 01:01:03 Re: Fixes for 8.1 run of pgindent
Previous Message Tom Lane 2005-11-15 00:38:00 Re: outer joins and for update