On 2017-09-15 15:39:49 -0400, Tom Lane wrote: > Andres Freund <and...@anarazel.de> writes: > > On 2017-09-14 23:29:05 -0400, Tom Lane wrote: > >> FWIW, I'm not on board with that. I think the version of typedefs.list > >> in the tree should reflect the last official pgindent run. > > > Why? I see pretty much no upside to that. You can't reindent anyway, due > > to unindented changes. You can get the used typedefs.list trivially from > > git. > > Perhaps, but the real problem is still this: > > >> There's also a problem that it only works well if *every* committer > >> faithfully updates typedefs.list, which isn't going to happen. > > We can't even get everybody to pgindent patches before commit, let alone > update typedefs.list.
Well, that's partially because right now it's really painful to do so, and we've not tried to push people to do so. You essentially have to: 1) Pull down a new typedefs.list (how many people know where from?) 2) Add new typedefs that have been added in the commit-to-be 3) Run pgindent only on the changed files, because there's bound to be thousands of unrelated reindents 4) Revert reindents in changed files that are unrelated to the commit. 1) is undocumented 2) is painful (add option to automatically generate?), 3) is painful (add commandline tool?) 4) is painful. So it's not particularly surprising that many don't bother. > >> For local pgindent'ing, I pull down > >> https://buildfarm.postgresql.org/cgi-bin/typedefs.pl > > > That's a mighty manual process - I want to be able to reindent files, > > especially new ones where it's still reasonably possible, without having > > to download files, then move changes out of the way, so I can rebase, > > Well, that just shows you don't know how to use it. You can tell pgindent > to use an out-of-tree copy of typedefs.list. I have the curl fetch and > using the out-of-tree list all nicely scripted ;-) Not sure how that invalidates my statement. If you have to script it locally, and still have to add typedefs manually, that's still plenty stuff every committer (and better even, ever contributor!) has to learn. > There might be something to be said for removing the typedefs list > from git altogether, and adjusting the standard wrapper script to pull > it from the buildfarm into a .gitignore'd location if there's not a > copy there already. I wonder if we could add a command that pulls down an up2date list *and* regenerates a list for the local tree with the local settings. And then runs pgindent with the combined list - in most cases that'd result in a properly indented tree. The number of commits with platform specific changes that the author/committer doesn't compile/run isn't that high. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (firstname.lastname@example.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers