Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRYOp-0004Ha-Hm for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 12:57:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pRYOo-0007n8-8Q for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Feb 2023 12:57:38 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRYOn-0007la-V2 for pgsql-hackers@lists.postgresql.org; Mon, 13 Feb 2023 12:57:37 +0000 Received: from relay10.mail.gandi.net ([2001:4b98:dc4:8::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pRYOm-0001UV-0D for pgsql-hackers@postgresql.org; Mon, 13 Feb 2023 12:57:37 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 0574A24000A; Mon, 13 Feb 2023 12:57:26 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------3kcCyw0Mhj89gvdk5iVBjKxs" Message-ID: <2701ad84-05c9-6381-1666-b874c3000d54@dunslane.net> Date: Mon, 13 Feb 2023 07:57:25 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: run pgindent on a regular basis / scripted manner Content-Language: en-US To: Justin Pryzby , Tom Lane Cc: Jelte Fennema , shiy.fnst@fujitsu.com, Robert Haas , Andres Freund , Noah Misch , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , pgsql-hackers@postgresql.org References: <0f074818-b01a-799f-3c74-5fb5deab1d23@dunslane.net> <1d66447e-a77b-ca0d-90a0-782800e85383@dunslane.net> <390e7b04-11f3-f715-7a7d-d1a9077fbea8@dunslane.net> <00885533-!ff96-2a95-7911-329c873b3029@dunslane.net> <842819.1676219054@sss.pgh.pa.us> <20230212205936.GV1653@telsasoft.com> From: Andrew Dunstan In-Reply-To: <20230212205936.GV1653@telsasoft.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------3kcCyw0Mhj89gvdk5iVBjKxs Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2023-02-12 Su 15:59, Justin Pryzby wrote: > It seems like if pgindent knows about git, it ought to process only > tracked files. Then, it wouldn't need to manually exclude generated > files, and it wouldn't process vpath builds and who-knows-what else it > finds in CWD. for vpath builds use an exclude file that excludes the vpath you use. I don't really want restrict this to tracked files because it would mean you can't pgindent files before you `git add` them. And we would still need to do manual exclusion for some files that are tracked, e.g. the snowball files. > > At least --commit doesn't seem to work when run outside of the root > source dir. > Yeah, I'll fix that, thanks for mentioning. cheers andrew -- Andrew Dunstan EDB:https://www.enterprisedb.com --------------3kcCyw0Mhj89gvdk5iVBjKxs Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


On 2023-02-12 Su 15:59, Justin Pryzby wrote:
It seems like if pgindent knows about git, it ought to process only
tracked files.  Then, it wouldn't need to manually exclude generated
files, and it wouldn't process vpath builds and who-knows-what else it
finds in CWD.


for vpath builds use an exclude file that excludes the vpath you use.

I don't really want restrict this to tracked files because it would mean you can't pgindent files before you `git add` them. And we would still need to do manual exclusion for some files that are tracked, e.g. the snowball files.



At least --commit doesn't seem to work when run outside of the root
source dir.


Yeah, I'll fix that, thanks for mentioning.


cheers


andrew


--
Andrew Dunstan
EDB: https://www.enterprisedb.com
--------------3kcCyw0Mhj89gvdk5iVBjKxs--