Tom Lane wrote:
> This case in xlog.c is representative of a disease that pgindent has had
> for awhile:
> 
> @@ -4276,7 +4300,8 @@ StartupXLOG(void)
>                 if (needNewTimeLine)    /* stopped because of stop request */
>                         ereport(FATAL,
>                                         (errmsg("requested recovery stop point is 
> before end time of backup dump")));
> -               else                                    /* ran off end of WAL */
> +               else
> +/* ran off end of WAL */
>                         ereport(FATAL,
>                                         (errmsg("WAL ends before end time of backup 
> dump")));
>         }
> 
> I'm not sure of all the triggering conditions, but every so often it
> decides to move a line-ending comment to its own line (which is a wrong
> policy in the first place IMHO) and forgets to indent it.  I've mostly
> seen it on "else" lines but I'm not sure that's the only case.

You are correct that it only happens on comments on an else line.  The
problem is that there is a BSD indent bug that will stop processing the
file in such cases so we have in pgindent:

        # workaround for indent bug with 'else' handling
        sed 's;\([}     ]\)else[        ]*\(/\*.*\)$;\1else\
        \2;g' |

and this does exactly as you describe by putting the comment on its own
line.  I just changed it to:

        # workaround for indent bug with 'else' handling
        sed 's;\([}     ]\)else\([      ]*\)\(/\*.*\)$;\1else\
        \2\3;g' |

so that the new comment will have the same indenting as the else that
was input.  It should help but will not be perfect.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  [EMAIL PROTECTED]               |  (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 4: Don't 'kill -9' the postmaster

Reply via email to