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 1pSVyL-0007vs-U8 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Feb 2023 04:34:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pSVyK-0003ZV-Jr for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Feb 2023 04:34:16 +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 1pSVyK-0003XH-9p for pgsql-hackers@lists.postgresql.org; Thu, 16 Feb 2023 04:34:16 +0000 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pSVyE-0004aN-8q for pgsql-hackers@postgresql.org; Thu, 16 Feb 2023 04:34:15 +0000 Received: by mail-qt1-x82c.google.com with SMTP id f10so1042867qtv.1 for ; Wed, 15 Feb 2023 20:34:09 -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=4xnB4uvnHNQ8XPzsZa6391hciQfQ57ta8qbNtRzlTk8=; b=LdDtEXbm0apNu0hVEEHA8m3v0MbNimHOY6Acbiw8G40SmH6Su9V7dcX+K4GjLRj5LR AqE6KJhF8686tChr1mSZP98Z9clXw7Y7kdirQ7XhfQ982GgS16EneMbLbk89WMF5EOsn I0Rv3kK5tjY0yd0gPQAtGkRgvIRx+/fK1c/+k= 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=4xnB4uvnHNQ8XPzsZa6391hciQfQ57ta8qbNtRzlTk8=; b=FZChTxIGqXRmgFtrRIIiGXiNGOmaidWEDBA6BR0OgE4p0mMpk5ZBwrqwLRr0dAW+y2 JikPYKZQw0AStASdz7qbPa5srwi+EtlNWWd6Do3+vaJUeDXZ/jDVYa0otlq1gPi5CC5u 89NaCTmbxuWT+BMJN1tDCZQVHPthDU2fUFrkdqqQtslK/9kdlmzDljAxLLQ/+s+kj0xz CIgWRr2E1t/uRD5w92PbC/eDEmHy+O1MV9yL2KOKLlV64xmQNfh+0o51omMhM8lmjxj3 7cGW/Fd55U3DZfQH3XBUK1VSqiosISL2lXSBZ9E0bJFulVNrPDNMd1SdPRLuc0GCoVuO ykpQ== X-Gm-Message-State: AO0yUKXiIoRCEh+fuEbvNugH2zxJQ6EtBvcaQGX18bie7d75NZU7vxE1 NYGKiuSkUvK9OEGH9hNgygJMMA== X-Google-Smtp-Source: AK7set8wQlhiNhz/DI0ZiVR2dwGQEPPLucSc/gSbXG1DjPcV5X9zZM+hOw0FwGRHHXzScWL+EN+mXw== X-Received: by 2002:ac8:5e0c:0:b0:3b8:2b4e:cbca with SMTP id h12-20020ac85e0c000000b003b82b4ecbcamr7978031qtx.14.1676522048231; Wed, 15 Feb 2023 20:34:08 -0800 (PST) Received: from rfd.leadboat.com ([2600:1702:a20:5750::2e]) by smtp.gmail.com with ESMTPSA id f17-20020ac80691000000b003b9b48cdbe8sm547272qth.58.2023.02.15.20.34.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2023 20:34:07 -0800 (PST) Date: Wed, 15 Feb 2023 20:34:04 -0800 From: Noah Misch To: Justin Pryzby Cc: Andrew Dunstan , Tom Lane , Jelte Fennema , shiy.fnst@fujitsu.com, Robert Haas , Andres Freund , Peter Geoghegan , Bruce Momjian , Magnus Hagander , Alvaro Herrera , Stephen Frost , Jesse Zhang , pgsql-hackers@postgresql.org Subject: Re: run pgindent on a regular basis / scripted manner Message-ID: <20230216043404.GA2385625@rfd.leadboat.com> References: <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> <2701ad84-05c9-6381-1666-b874c3000d54@dunslane.net> <20230215184552.GS1653@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230215184552.GS1653@telsasoft.com> 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 Wed, Feb 15, 2023 at 12:45:52PM -0600, Justin Pryzby wrote: > On Mon, Feb 13, 2023 at 07:57:25AM -0500, Andrew Dunstan wrote: > > 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. > > > > I don't really want restrict this to tracked files because it would mean you > > can't pgindent files before you `git add` them. > > I think you'd allow indenting files which were either tracked *or* > specified on the command line. > > Also, it makes a more sense to "add" the file before indenting it, to > allow checking the output and remove unrelated changes. So that doesn't > seem to me like a restriction of any significance. > > But I would never want to indent an untracked file unless I specified > it. Agreed. I use pgindent three ways: 1. Indent everything that changed between master and the current branch. Most common, since I develop nontrivial patches on branches. 2. Indent all staged files. For trivial changes. 3. Indent all tracked files. For typedefs.list changes. That said, pre-2023 pgindent changed untracked files if called without a file list. I've lived with that and could continue to do so.