Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Akshay Joshi <akshay.joshi@enterprisedb.com>
From: Akshay Joshi <akshay.joshi@enterprisedb.com>
To: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-02-17T07:54:05Z
Lists: pgsql-hackers
Attachments
- v2-0001-Fix-pgindent-truncates-last-line-of-files.patch (application/octet-stream) patch v2-0001
I have addressed the review comments from Andrew. Attached is the v2 patch, ready for review. On Tue, Feb 17, 2026 at 7:50 AM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> wrote: > > On Mon, Feb 16, 2026 at 10:20 PM Tom Lane <tgl@sss.pgh.pa.us> wrote: > > > > Andrew Dunstan <andrew@dunslane.net> writes: > > > Yeah. I wonder if we shouldn't be just ensuring that there is a line > > > feed at the end of the buffer, i.e. add one if it's not there. We > > > shouldn't be adding files without a trailing LF, and ensuring there is > > > one seems like a reasonable thing to do in pg_bsd_indent. > > > > +1 > > +1. That will allow me to remove some code from my patch preparation > script. Ref. [1] > > [1] https://www.postgresql.org/message-id/flat/CAExHW5v8u7-2H2LqWP3ybhh5GnAVVeCOYuTfkg9pmdnrLwAtNA%40mail.gmail.com#fdbb87e825f89e7109dfb0ed959b2dd4 > > -- > Best Wishes, > Ashutosh Bapat
Commits
-
pgindent: ensure all C files end with a newline.
- 79ac82125ef6 19 (unreleased) landed