Re: [PATCH] pgindent truncates last line of files missing a trailing newline

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Date: 2026-03-29 02:26:35
Message-ID: aciN28vXRQVIWQzs@momjian.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 27, 2026 at 03:28:16PM -0400, Tom Lane wrote:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> > On 2026-03-26 Th 12:29 PM, Tom Lane wrote:
> >> I'm not sure I want to expend the brain cells to figure out whether
> >> this is a correct/complete patch. If pg_bsd_indent were less of an
> >> undercommented spaghetti-code nightmare, maybe fixing it here would
> >> be reasonable. But as things stand, why don't we just fix this in
> >> the perl wrapper, as attached?
>
> > Well, I thought we were trying to reduce the fixups we did in pgindent.
>
> Yeah, other things being equal I too would prefer to fix it within
> pg_bsd_indent. But other things are not equal: the complexity
> and reviewability of the proposed v2 patch are not comparable to
> a one-liner fix in the wrapper.

I think the only way forward if we want to continue modifying
pg_bsd_indent is to rename most of the variables and add some sanity to
the code.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Do not let urgent matters crowd out time for investment in the future.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Evgeny Voropaev 2026-03-29 04:53:48 Re: Compress prune/freeze records with Delta Frame of Reference algorithm
Previous Message Thomas Munro 2026-03-29 02:01:24 Re: pg_waldump: support decoding of WAL inside tarfile