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 1pNT5W-0003qN-UY for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Feb 2023 06:28:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pNT5V-0002Y8-6g for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Feb 2023 06:28:49 +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 1pNT5U-0002Xj-MN for pgsql-hackers@lists.postgresql.org; Thu, 02 Feb 2023 06:28:48 +0000 Received: from mail-oo1-xc2c.google.com ([2607:f8b0:4864:20::c2c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pNT5P-00017u-M9 for pgsql-hackers@postgresql.org; Thu, 02 Feb 2023 06:28:48 +0000 Received: by mail-oo1-xc2c.google.com with SMTP id k15-20020a4adfaf000000b00517450f9bd7so104688ook.8 for ; Wed, 01 Feb 2023 22:28:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=apugvWXK1Qe8w9e2vS/iGCujIhkr40VGA4jx7DgLje8=; b=ZGPvCx5B10qbci95UiursO9uEG/oRrQ3oUI4fQTpaMttlScJuXqHLSt7NITavkbJ9z 2FQz32ATz1G2B0iBqjQIN9ahNXYGOuSrHHXW71ZcVwnlbm6/u4zyPJG3XR1GkmHh4UNk HdzTmzN3y0EjM4ZtTMUlzAknqMBUReAp9cs9g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=apugvWXK1Qe8w9e2vS/iGCujIhkr40VGA4jx7DgLje8=; b=EdBrV5JQLIORhTrhU7PtKGLWFi9l7+sAxZ6NvRs88IGpVoLNLce9Qc/TbAo2ztWjHB rE7CoMLlB2DfbJjg1d1COhYhgAl9+Futo9G6qUchUcWETb/qJGAjdjy1+PrM1tmQvvIb OfP/Ng2ducbk/ty+C7ZaWwjWtJDcNKqrolMzcIusr5P2KMVBksgMQLTKYtaod0kRPlfu KSpIlkNNeR+F9FWu9X9rlLg9unAV7COWZHfYyKp9dq3eMJp2+HGtSGQUh3vcQsL409h1 Brs5Wzx8l/+V5ron6vMISZkh+V0GIC31amX7QmwIrOl+ilx2DRUEyT0tsgDn9dOqcrh5 SLCQ== X-Gm-Message-State: AO0yUKUdpFWB/X0TRbjWADzw1XvNMcZ38bnrZ+lTMmPe148plgFemlYQ pCpx+kfijPsDUEIGlxFCMNhzZQ== X-Google-Smtp-Source: AK7set8BNpqmKyhuYkaPH83mHUo+XXTMhZEbbamHK9LqEJLq1wUD+4XKAozmWtxa4IcPRwxh92bSvQ== X-Received: by 2002:a4a:dfc7:0:b0:519:b605:9d78 with SMTP id p7-20020a4adfc7000000b00519b6059d78mr2266245ood.7.1675319321454; Wed, 01 Feb 2023 22:28:41 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id e79-20020a4a5552000000b0051765eb8c25sm5096259oob.10.2023.02.01.22.28.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2023 22:28:40 -0800 (PST) Date: Wed, 1 Feb 2023 22:28:38 -0800 From: Noah Misch To: Bruce Momjian Cc: Tom Lane , Jelte Fennema , Andres Freund , Peter Geoghegan , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner Message-ID: <20230202062838.GA1832088@rfd.leadboat.com> References: <20230123011002.fzcaa3krql3mqsfn@awork3.anarazel.de> <1509591.1674437376@sss.pgh.pa.us> <1608158.1674486546@sss.pgh.pa.us> <20230123173136.knn77pbuakhvjfgk@awork3.anarazel.de> <2238493.1674572097@sss.pgh.pa.us> <20230129010603.GA1677550@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 30, 2023 at 03:42:09PM -0500, Bruce Momjian wrote: > On Sat, Jan 28, 2023 at 05:06:03PM -0800, Noah Misch wrote: > > On Tue, Jan 24, 2023 at 02:04:02PM -0500, Bruce Momjian wrote: > > > On Tue, Jan 24, 2023 at 09:54:57AM -0500, Tom Lane wrote: > > > > As another example, the mechanisms we use to create the typedefs list > > > > in the first place are pretty squishy/leaky: they depend on which > > > > buildfarm animals are running the typedef-generation step, and on > > > > whether anything's broken lately in that code --- which happens on > > > > a fairly regular basis (eg [1]). Maybe that could be improved, > > > > but I don't see an easy way to capture the set of system-defined > > > > typedefs that are in use on platforms other than your own. I > > > > definitely do not want to go over to hand maintenance of that list. > > > > > > As I now understand it, we would need to standardize on a typedef list > > > at the beginning of each major development cycle, and then only allow > > > additions, > > > > Not to my knowledge. There's no particular obstacle to updating the list more > > frequently or removing entries. > > We would need to re-pgindent the tree each time, I think, which would > cause disruption if we did it too frequently. More important than frequency is how much old code changes. A new typedef typically is an identifier not already appearing in the tree, so no old code changes. A removed typedef typically no longer appears in the tree, so again no old code changes. The tree can get those daily; they're harmless. The push that adds or removes FooTypedef from the source code is in the best position to react to any surprising indentation consequences of adding or removing FooTypedef from typedefs.list. (Reactions could include choosing a different typedef name or renaming incidental matches in older code.) Hence, changing typedefs.list as frequently as it affects the code is less disruptive than changing it once a year. The same applies to challenges like pgindent wrecking a non-"/*----------" comment. Such breakage is hard to miss when it's part of the push that crafts the comment; it's easier to miss in a bulk, end-of-cycle pgindent. Regarding the concern about a pre-receive hook blocking an emergency push, the hook could approve every push where a string like "pgindent: no" appears in a commit message within the push. You'd still want to make the tree clean sometime the same week or so. It's cheap to provide a break-glass like that.