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

From: Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>
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>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCH] pgindent truncates last line of files missing a trailing newline
Date: 2026-02-17 02:20:42
Message-ID: CAExHW5uSuG9qcGd=o6o6TiwWUKE4ie7K7nmgKzDzUKxrQ9rYDw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Feb 16, 2026 at 10:20 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Andrew Dunstan <andrew(at)dunslane(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2026-02-17 02:38:05 Re: Questionable description about character sets
Previous Message Hayato Kuroda (Fujitsu) 2026-02-17 01:56:00 RE: Improve docs syntax checking and enable it in the meson build