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 1k64Ir-0004yI-Ib for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2020 03:53:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1k64Ip-0004I6-79 for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Aug 2020 03:53:19 +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 1k64Io-0004Ha-W8 for pgsql-hackers@lists.postgresql.org; Thu, 13 Aug 2020 03:53:19 +0000 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1k64Ik-0000gZ-2P for pgsql-hackers@postgresql.org; Thu, 13 Aug 2020 03:53:15 +0000 Received: by mail-pj1-x1043.google.com with SMTP id d4so2123411pjx.5 for ; Wed, 12 Aug 2020 20:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XnZQzMTImFOvTSmDfkY3+ysrb/dohbnpczL+SthBki0=; b=S0dWcU+V1dH9zRjkYxEkEvAr03Yp+G/jpB7XiQaSAbRgjZO/OoYl/mo1cUz2fzD6Yg L/USEXasj+KC44pgtqVirJzaeT5eV88JBcNoUSqCz4SJn13RpvbOg+gkAjSiPTsEUKW6 G5usNeXEJs+/+oULLKCMeHH2cL7bV/uakomY0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=XnZQzMTImFOvTSmDfkY3+ysrb/dohbnpczL+SthBki0=; b=XiACZ1Pj9s88zPkmKPU2I/dYLt5P3mWvXaboeNH7+2X2OzlRWoCDQ+WEuBQmqxy3yi 54Pkah2nYm6O6U+yrbt4853/96mzZjmqcUahxmAOy/rNWkoQKf6rOD9/J+Is6pBBGKAk yx/GJlYooXvbclzoX64QTr90PmJFvnGs1QjqkxLWXKyw9Mk9STTiyDNqjYKb0UotgQzO McPZVcpvUdnuwAOLg9AbqHmH4wa4ZAG5AGu6gB4Ze7cmdrEE0fC708YIvBrD5ORy/QBk qz737WhQ9dnwDr2ISeQCLyzPEQYSdG/aNlOoTafHrf2W9bZ5WinkOW5BFUQ125Uy+QEE B0Ig== X-Gm-Message-State: AOAM532ZgIT0s4dfdKO6qGe0y6ef0ExH1JoJOe1AytQN8MeytNZrFzl1 1rbwbmJxdPo8sBZXwmxRuOk5zA== X-Google-Smtp-Source: ABdhPJyHBntd6LxeQ2x+VaGsRuKqEKwAvkFrHePy3uWXxWk0SdqotmduD2z7aHoJ0Lomi6/KkIJnkg== X-Received: by 2002:a17:90b:138a:: with SMTP id hr10mr3004753pjb.161.1597290791380; Wed, 12 Aug 2020 20:53:11 -0700 (PDT) Received: from rfd.leadboat.com (108-233-125-46.lightspeed.sntcca.sbcglobal.net. [108.233.125.46]) by smtp.gmail.com with ESMTPSA id e13sm3581902pgs.13.2020.08.12.20.53.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Aug 2020 20:53:10 -0700 (PDT) Date: Wed, 12 Aug 2020 20:53:08 -0700 From: Noah Misch To: Tom Lane Cc: Jesse Zhang , Andres Freund , PostgreSQL-development Subject: Re: run pgindent on a regular basis / scripted manner Message-ID: <20200813035308.GA1137170@rfd.leadboat.com> References: <20200812223409.6di3y2qsnvynao7a@alap3.anarazel.de> <328084.1597276021@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <328084.1597276021@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Aug 12, 2020 at 07:47:01PM -0400, Tom Lane wrote: > Jesse Zhang writes: > > On Wed, Aug 12, 2020 at 3:34 PM Andres Freund wrote: > >> Is there any reason we don't just automatically run pgindent regularly? > >> Like once a week? And also update typedefs.list automatically, while > >> we're at it? > > > You know what's better than weekly? Every check-in. > > I'm not in favor of unsupervised pgindent runs, really. It can do a lot > of damage to code that was written without thinking about it --- in > particular, it'll make a hash of comment blocks that were manually > formatted and not protected with dashes. > > If the workflow is commit first and re-indent later, then we can always > revert the pgindent commit and clean things up manually; but an auto > re-indent during commit wouldn't provide that history. There are competing implementations of assuring pgindent-cleanliness at every check-in: 1. After each push, an automated followup commit appears, restoring pgindent-cleanliness. 2. "git push" results in a commit that melds pgindent changes into what the committer tried to push. 3. "git push" fails, for the master branch, if the pushed commit disrupts pgindent-cleanliness. Were you thinking of (2)? (1) doesn't have the lack-of-history problem, but it does have the unexpected-damage problem, and it makes gitweb noisier. (3) has neither problem, and I'd prefer it over (1), (2), or $SUBJECT. Regarding typedefs.list, I would use the in-tree one, like you discussed here: On Wed, Aug 12, 2020 at 07:57:29PM -0400, Tom Lane wrote: > Maybe the secret is to not allow automated adoption of new typedefs.list > entries, but to require somebody to add entries to that file by hand, > even if they're basing it on the buildfarm results. (This would > encourage the habit some people have adopted of updating typedefs.list > along with commits that add typedefs. I've never done that, but would > be willing to change if there's good motivation to.)