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.94.2) (envelope-from ) id 1vDY2b-00B8Me-S7 for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 00:58:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1vDY2Y-00A1dI-Pu for pgsql-hackers@arkaria.postgresql.org; Tue, 28 Oct 2025 00:58:21 +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.94.2) (envelope-from ) id 1vDY2Y-00A1d3-Ev for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 00:58:21 +0000 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vDY2U-004bnr-2R for pgsql-hackers@lists.postgresql.org; Tue, 28 Oct 2025 00:58:21 +0000 Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-33d896debe5so5971455a91.0 for ; Mon, 27 Oct 2025 17:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761613096; x=1762217896; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=dUaQ5DCkS5cYZg3xJbYcQeWOiPr34/zHcFB3PZ6jlD4=; b=ZsWqR8RktcUjzPgB5J6U2AQTMEMxr6E1ONJtwoSTuusVsBh78Q3vthCeqqqDJMkruO REwVigMckOGt0FZ9yGCh8bGElWibRtY45qaFjBJMI4wzruCNwAjoKscGBl5+LmmSGp1R 1Uf+/jdWAwWMyzzSBXpcEbLOjpE1ZZrC/kSiB7Vdvo4eH/1VsO8SNEKmUvMFfJ7YrwEZ Ws20qRlG1ALMb1ZpjhGpSJSvLv2NpkUoYAF4jSgei2zEBy2Xe4T2217XkA7RjbP4sKDS FagK7aubbZVro7Smjl7sObDySj6MJ3KSGpivQWlkAXVxL5H+ixWsTyq/MEDDoI0nVVxg 2brA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761613096; x=1762217896; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dUaQ5DCkS5cYZg3xJbYcQeWOiPr34/zHcFB3PZ6jlD4=; b=GdDlPaecJxgdXTOSFjrwvW4bOqbHk2UU2s/i+NSH0KxDpDZ0m+Iuh/gjbvUy/DEMRZ bFXmJHRNBXnIH7EO9xew3oZad+t+WN9w6j6eWJq4WnBPxzpQGHj66FuSaNlui5gPGYiQ exZ4OIB6vKqTfkYXuBaJHIXj27QN6/QWQCzhsvF3I8e4mGYeKOB0DdaGyhZcq4McG+bX 5Z55LE9Jtjsq5+udT8CiCnvgWlhZke56lIpU9IVxGi3aqmsx21K3nFu1C80/Cai6ooUQ +F4+miZTgd7gpWqs8wuWngoLwJ+QtDUmpwzfYRApD7AxeO0GCz+cpoRrPYV7Sv/Q/l58 Vs/w== X-Gm-Message-State: AOJu0YyAjquRiasyWwlR7r5KjiCY8d6Q0eS0gL1XP1kDKuhMDxhlqol+ hpb2Yk2Rbh2Jux37M0IelW4wmVCB0Mp0Wp9FEHlrbrP9qF8ib0hQZQZS X-Gm-Gg: ASbGncvJ88OzgyRxoGg5DrqNpgL+bEIhlH2otySlWSVDHPbIH1jFulVAaGwEWG98sBW lcdP6LxNujglNg612w/29RWak0f7ACPXdXS1T+NKAIFBd9KAVCCQu8zj9I0Q6YcoOwCVKJNJcJ4 mMf12FWa5RHMIParTSurgD5gKsd9cLGk+tG9HNGg2R3X1SRYPYQWGwsaepA/Q/KDDYDa9XOCjep gs8uhOechl4BgLlC6d8gxsn7dOuVeNc3vBR0buQInCpOnHCPQhFA3LPETN/b0HaQM1aarQfVLrj YVxHzLYIo1aqZynIAwmHIcS/Uh8EH1jGGqdEreaAyM+HecUyduOfGyflWKN5CGwxa3JWXwdjlTH IWVHcq5L4VvsLTtg5xVx3Oxx5iei8U/pjU9R1VyVq4SVA64wLePsdMfOCgxRGgReyeVcaudpAAu SVyaqPP+FIilM= X-Google-Smtp-Source: AGHT+IExOdysnc5ynLj5U3C2IiKmt5/7v8PkiGN7sxewMJnjaJxYqo/pZ684uu/fsBPIRSwakhZ5hA== X-Received: by 2002:a17:90b:248b:b0:340:29be:7838 with SMTP id 98e67ed59e1d1-34029be7854mr773065a91.29.1761613095650; Mon, 27 Oct 2025 17:58:15 -0700 (PDT) Received: from smtpclient.apple ([170.178.170.211]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-33fed7f3aeesm9923512a91.14.2025.10.27.17.58.09 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Oct 2025 17:58:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: [PATCH] pg_bsd_indent: improve formatting of multiline comments From: Chao Li In-Reply-To: Date: Tue, 28 Oct 2025 08:57:36 +0800 Cc: PostgreSQL Hackers , Nathan Bossart , Arseniy Mukhin , Bruce Momjian , Michael Paquier Content-Transfer-Encoding: quoted-printable Message-Id: <9AD706B0-B73A-4DCC-9A71-F924D8B74F4B@gmail.com> References: To: Aleksander Alekseev X-Mailer: Apple Mail (2.3826.700.81) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Oct 27, 2025, at 20:13, Aleksander Alekseev = wrote: >=20 > Hi Nathan, >=20 >>> Personally I don't have a strong opinion on this. We can easily add = an >>> exception for "/* ---" and "/* =3D=3D=3D" 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 :) >>=20 >> +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. >=20 > OK, here is the corrected patch v5. >=20 > --=20 > Best regards, > Aleksander Alekseev > 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 =3D> 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 =3D QUEUE_PAGESIZE - curoffset; ``` In the =E2=80=9Celse=E2=80=9D clause, there is a multiple-line comment = block, and a single line of code. Pgindent will add an empty line = between =E2=80=9Celse=E2=80=9D 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/