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 1vXRzc-00Abq7-1P for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Dec 2025 22:33:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vXRza-00CVRC-1D for pgsql-hackers@arkaria.postgresql.org; Sun, 21 Dec 2025 22:33:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vXRza-00CVR3-0D for pgsql-hackers@lists.postgresql.org; Sun, 21 Dec 2025 22:33:34 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vXRzY-001yED-1G for pgsql-hackers@lists.postgresql.org; Sun, 21 Dec 2025 22:33:34 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 37998EC0087; Sun, 21 Dec 2025 17:33:30 -0500 (EST) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-06.internal (MEProxy); Sun, 21 Dec 2025 17:33:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1766356410; x=1766442810; bh=emwPmAw6JR Nyc27ueVHEvDY2dNCeuv5GQwZo3feHWDE=; b=Gd2y9MC1LmPE2n2Gk8aIVA0Bh6 Iz4m6tT2AmlX8L6Y9VHMGUvjzSCYUNCq+qXNR1TfIp2CFOWESa2wPhk6Es8LgpMV /dm7aQu/iQxnFb52fgLohPfTAkT541RuoEyUoprdJGVGh15P2kCn24O9/lkVY6H3 LeRRzvhGEhPhbOiuLyhbIqe2VMcnCKYgG2v6zhidGSVFNotgK22vVKMC+3FF0LUC APPnQ0DD/e4q4n8zPj+IG8+TdKo0jUKnOpUbs9y1tognxmEQRvrhH0fURCY0y1kQ kqq8wGmoWh+y+ncWnQ8wPjP+jDGlO0K8Gy/K7cshE0vLL2SMjYzUnFasmQ7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1766356410; x=1766442810; bh=emwPmAw6JRNyc27ueVHEvDY2dNCeuv5GQwZ o3feHWDE=; b=KOeJgV6VDYTRY/Tb6ioxSvoJPjsMItTl6jLLhiEgrURp0TP4l/V aNeDkTWhreAKgeqMWOzwLLK0a/MbUS54xWoWg7Olundi/N6kEOkSH+9tnT0sAMxD uutH1gha71K07xi/h7VbQ0+SpPMbxwZUGIxRWVyyWa/Kc4g8FTWb+hQPJJcqzGOy izXM/FYbjyRCs6Ghg5nYK8EaH6NjSYSRvHmn65VN1FWlZMLNFHQqrVSAUVC0pjUt Mw46le1XLuJm1BUC0xFaG2s6R+aDbs2DucGv7FVZMxNfeu3iGA+VIc+AU4sXHAwI 46Ue9L4ywauG//ijzekK7Pl8hq2vgaJkfhw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdehhedvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlh cuvffnffculdejtddmnecujfgurhepfffhvfevuffkfhggtggujgesghdtreertddtvden ucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprghquh hivghrrdighiiiqeenucggtffrrghtthgvrhhnpeetleeifedufffhhfdtteelgeeggeff hfekueevteeigfduudevudetgfegiedvjeenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiipdhn sggprhgtphhtthhopeekpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsrhhutg gvsehmohhmjhhirghnrdhushdprhgtphhtthhopehtghhlsehsshhsrdhpghhhrdhprgdr uhhspdhrtghpthhtoheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhrtghpth htoheprghlvghkshgrnhguvghrsehtihhgvghruggrthgrrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhgpd hrtghpthhtohepnhgrthhhrghnuggsohhsshgrrhhtsehgmhgrihhlrdgtohhmpdhrtghp thhtoheplhhirdgvvhgrnhdrtghhrghosehgmhgrihhlrdgtohhmpdhrtghpthhtoheprg hrshgvnhhihidrmhhukhhhihhnrdguvghvsehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 21 Dec 2025 17:33:27 -0500 (EST) Date: Mon, 22 Dec 2025 07:33:15 +0900 From: Michael Paquier To: Bruce Momjian Cc: Tom Lane , =?iso-8859-1?Q?=C1lvaro?= Herrera , Aleksander Alekseev , PostgreSQL Hackers , Nathan Bossart , Chao Li , Arseniy Mukhin Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments Message-ID: References: <202512121547.dwkzxcs56227@alvherre.pgsql> <1000974.1765556221@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lwF1mOZTpWasDAVf" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --lwF1mOZTpWasDAVf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 19, 2025 at 03:02:12PM -0500, Bruce Momjian wrote: > On Fri, Dec 12, 2025 at 11:17:01AM -0500, Tom Lane wrote: >> =3D?utf-8?Q?=3DC3=3D81lvaro?=3D Herrera writes: >>> It's strange to see this thread go on about messing with the Perl script >>> because we're too afraid of pg_bsd_indent. Maybe we should take >>> ownership of that code -- improve its own indentation to our >>> conventions, add comments, rename unclear variables, and so on until we >>> have something we can work with, and fix these weird bugs and >>> idiosincratic behaviors we don't like. I just found out this code dates >>> back from 1976. >>=20 >> I've worked with that code a little bit, and it's mostly unreadable >> spaghetti :-(. If somebody wants to make an effort to make it not >> so awful, that'd be great, but I fear it's a very nontrivial project. >=20 > Yes, this is why we had to wrap the pg_bsd_indent call in Perl. Removing one layer, finishing with only a C function or a perl script would be really nice. I am wondering if removing the perl script would not be the way to go, just owning the portion of the code we care about, which is already in the tree anyway. =46rom what I can see, we rely on a set of options through $indent_opts, it seems like one would enter a fail-and-retry repeat loop until things get rather right:=20 - Remove as much code from pg_bsd_indent as possible. - Integrate some of the options in the perl script into the binary. If the binary gets slim enough and more understandable, perhaps we could even keep both, we have all the pgtypedef business which is specific to the Postgres tree as well. -- Michael --lwF1mOZTpWasDAVf Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmlIdasACgkQnvQgOdby QH2lHhAAm1d5yX3jLLLIaM2mup6O1tIt3BvzvYnT8qx0mYimG36hKC/jquQyyOC7 RVEXPuN9swPbRRH/7WfmTYGPNFJuQVS5YYyoB8QGkGBuF6yeUbYSB2xN35PG2mzb BTnKRbgFU+ThjY3o8F+xl4Bx+By7lkHPDzIcVOsQN+3gw6vDmi3ojsnboZ+kyYFJ c3sTQpic7uP03eSvqr0PsR7TX5hpDxjBfswPDdSAnW+ENEHAB4VZtFyZhu6Pevtu o1cVcdHdgH9GUYW7M+l+Y2d8LEl17Qpbf/XersdaihN4iSDi0thZEQgblaArhKgF OzNaov0+basw8EnlzB1CpAvjih88udr25CwEXJO2suf6Jdg5ipNUNzK/ztb5ijLw W2UdFdn2/Yh3kEsRhvISy1pQQhf09YirYTBchbCCphir2vmpgWUmE9BhjvHQLFkf 8Temtv7NuWgtpzhZBWT9PpcOduoTCZwBvCDFGFhtOBsF0XFas5ru4Z0/Q//5vz2/ FYNFv3HV0ZZULjgotHG9JLEbuRm5t3osf1+xaLJ2jPcKzkbnX0D9rp7C6vmgJy/0 lLFY3wU5qnZ4E7sNuLZeaoWTrjlsIXMlKALSkfO6ZMWgn/EecYt5oQnUM2LSApwX FEY/NGHKoyIdW5zOvs85RAeQEuSGbHscA8DXHkvU02vBn3+Ix1g= =XbWC -----END PGP SIGNATURE----- --lwF1mOZTpWasDAVf--