Tom Lane wrote:
> Bruce Momjian <pgman@candle.pha.pa.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@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to