Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6frR-004XIy-0a for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Mar 2026 02:26:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6frO-00FdiY-0U for pgsql-hackers@arkaria.postgresql.org; Sun, 29 Mar 2026 02:26:42 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w6frN-00FdiP-2b for pgsql-hackers@lists.postgresql.org; Sun, 29 Mar 2026 02:26:42 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w6frM-00000001a4R-1oYw for pgsql-hackers@postgresql.org; Sun, 29 Mar 2026 02:26:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2026010100; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description; bh=nORx/Yzz9O2C1l6aFfvgZM3xWwOTv1BQZh2iHRub0H4=; b=PD3BT /SecKnul1nqHWhVynROooFzDYtb49V2veSZa6UGJegB+f6T6mcz449QWCvu83jzulHdmIqGWlGpfI ihQVTLyenzaIM+VsHBEx8my/SsBrRB1VP3Fzqtl7y6jW89ZO9niXmP33omleTuPlAZDasyQkwFYvD 2lha0DXT+iTLZ7jc3HTWuJHYdppm6TyxL0gNEAnfBVjSoVcBlDnoaGZaMMjy0fyJMhbGbmIfRO/b2 SOaKBC9CN9PkRcs0e+89+nkL5q5jGG0tODUkGpx5Z6cKW57dgNvN70NvBt1wnjiFBULvFeiP9o/cq GoXcXUOXAwPp1x+6AGb6NdfevIaRw==; Received: from bruce by momjian.us with local (Exim 4.98.2) (envelope-from ) id 1w6frH-0000000DnH5-2ppo; Sat, 28 Mar 2026 22:26:35 -0400 Date: Sat, 28 Mar 2026 22:26:35 -0400 From: Bruce Momjian To: Tom Lane Cc: Andrew Dunstan , Akshay Joshi , Ashutosh Bapat , pgsql-hackers Subject: Re: [PATCH] pgindent truncates last line of files missing a trailing newline Message-ID: References: <3bd49b59-7a87-4ab6-9eac-59b5d9cb78de@dunslane.net> <1133418.1771260634@sss.pgh.pa.us> <1005500.1774542586@sss.pgh.pa.us> <1352724.1774639696@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1352724.1774639696@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 27, 2026 at 03:28:16PM -0400, Tom Lane wrote: > Andrew Dunstan 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 https://momjian.us EDB https://enterprisedb.com Do not let urgent matters crowd out time for investment in the future.