public inbox for [email protected]  
help / color / mirror / Atom feed
From: Chao Li <[email protected]>
To: Aleksander Alekseev <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Arseniy Mukhin <[email protected]>
Cc: Bruce Momjian <[email protected]>
Cc: Michael Paquier <[email protected]>
Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
Date: Tue, 28 Oct 2025 08:57:36 +0800
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAJ7c6TMTzQsnKfM+_4i-4WO7=YnV4nO8ABWA6enSpdtg6DKhqQ@mail.gmail.com>
References: <CAJ7c6TPQ0kkHQG-AqeAJ3PV_YtmDzcc7s+_V4=t+xgSnZm1cFw@mail.gmail.com>
	<CAE7r3MJ=CcWw65=C=tET32z5joixFqMDY_XhCxvjpLcOL3nVAQ@mail.gmail.com>
	<CAJ7c6TOp_h5Ueu8tPTnmponG84oFrm3D+zFWBwae-80do6o-rA@mail.gmail.com>
	<[email protected]>
	<CAJ7c6TOCJG2p0Ob9Z7mXQRhkmRX_mxBay198Z173t4=PZr=yEQ@mail.gmail.com>
	<CAE7r3M+phC+kyJsUrJ6z97-UA0LXRrUBJ61hBk7WhRqdXF_itQ@mail.gmail.com>
	<CAJ7c6TOGdVBK5P-s59c77qxaw=ydPjpzp_s3VbpHeHn3Gc1iyA@mail.gmail.com>
	<aPqPK4ERy5-jj185@nathan>
	<CAJ7c6TMTzQsnKfM+_4i-4WO7=YnV4nO8ABWA6enSpdtg6DKhqQ@mail.gmail.com>



> On Oct 27, 2025, at 20:13, Aleksander Alekseev <[email protected]> wrote:
> 
> Hi Nathan,
> 
>>> Personally I don't have a strong opinion on this. We can easily add an
>>> exception for "/* ---" and "/* ===" comments if somebody believes this
>>> is a problem. I choose not to add such an exception just yet only
>>> because I don't like unnecessary exceptions :)
>> 
>> +1 for adding an exception for "/* -----" style comments.  I tested running
>> pgindent after applying the patch, and the first thing I noticed was all
>> these (IMHO) unnecessary changes.  I don't think it helps readability, and
>> even if it did, it's arguably not worth the churn.
> 
> OK, here is the corrected patch v5.
> 
> -- 
> Best regards,
> Aleksander Alekseev
> <v5-0001-pgindent-improve-formatting-of-multiline-comments.patch>

1. I just ran the patched pgindent against a random file, then I got a lot diffs like:

```
        /*
-        * Direct advancement: avoid waking non-caught up backends that
-        * aren't interested in our notifications.
+        * Direct advancement: avoid waking non-caught up backends that aren't
+        * interested in our notifications.
         */
```

I am afraid that would generate a lot of noises for future reviews.

2. A typo in the patch

```
+    # Check each line except for the fist and the last one
```

fist => first

3. As you are updating pgindent, I want to report an issue, you may address in a separate patch or just in this patch, up to you.

See this code:
```
            else
                 /*
                  * fetch all the rest of the page
                  */
                 copysize = QUEUE_PAGESIZE - curoffset;
```

In the “else” clause, there is a multiple-line comment block, and a single line of code. Pgindent will add an empty line between “else” and the comment block, which is weird. If the comment is one-line, then no empty line will be inserted.

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/






view thread (26+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox