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

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

Akshay Joshi <akshay(dot)joshi(at)enterprisedb(dot)com> writes:
> I have addressed the review comments from Andrew.
> Attached is the v2 patch, ready for review.

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?

(In any case, I'm not in favor of adding a test case, because that
would require putting a trailing-newline-less .c file into our tree.
At best there would be a permanent hazard of something "fixing"
the file.)

regards, tom lane

Attachment Content-Type Size
v3-0001-Fix-pgindent-truncates-last-line-of-files.patch text/x-diff 417 bytes

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sami Imseih 2026-03-26 16:34:32 Re: Clean up NamedLWLockTranche stuff
Previous Message Nathan Bossart 2026-03-26 16:07:52 Re: Fixes inconsistent behavior in vacuum when it processes multiple relations