Re: pgindent run?

From: Mark Dilger <hornschnorter(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgindent run?
Date: 2017-11-28 22:34:08
Message-ID: E9929C7F-E6C6-4CAB-9707-FF00EDC65EFF@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> On Nov 28, 2017, at 12:47 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Mark Dilger <hornschnorter(at)gmail(dot)com> writes:
>> I have no objection, but if the community intends to keep everything
>> indented per project standards, why is there no git hook to reject
>> improperly indented code at commit time? I've suffered some pain
>> trying to merge code pre-global-indent-run into a branch
>> post-global-indent-run and would rather this not keep happening.
>
> I think that'd be taking it too far, especially given that the dependency
> on a typedefs list means that the git hook might have a different idea
> of what's correctly indented than the committer does. It'd be very hard
> to debug such discrepancies and figure out what would satisfy the hook.

It sounds like it just requires that the committer also commit any changes
to the typedefs list, such that the indenter run by the git hook can use the
same list the committer is using. For many commits, the typedefs list won't
change, and the hook would just use the most recent one from the repository.

Barring any objections, I'll see if I can make that work on my local git repo
and post a patch if so.

mark

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-11-28 22:36:45 Re: [HACKERS] Assertion failure when the non-exclusive pg_stop_backup aborted.
Previous Message Michael Paquier 2017-11-28 22:33:10 Re: [JDBC] [HACKERS] Channel binding support for SCRAM-SHA-256