Re: Maintaining a list of pgindent commits for "git blame" to ignore

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Maintaining a list of pgindent commits for "git blame" to ignore
Date: 2021-03-18 21:10:12
Message-ID: 20210318211012.GA3572@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 18, 2021 at 01:46:49PM -0700, Peter Geoghegan wrote:
> Recent versions of git are capable of maintaining a list of commits
> for "git blame" to ignore:
>
> https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame
>
> I tried this out myself, using my own list of pgindent commits. It
> works very well -- much better than what you get when you ask git to
> heuristically ignore commits based on whitespace-only line changes.
> This is not surprising, in a way; I don't actually want to avoid
> whitespace. I just want to ignore pgindent commits.
>
> Note that there are still a small number of pgindent line changes,
> even with this. That's because sometimes it's unavoidable -- some
> "substantively distinct lines of code" are actually created by
> pgindent. But these all seem to be <CR> lines that are only shown
> because there is legitimately no more appropriate commit to attribute
> the line to. This seems like the ideal behavior to me.
>
> I propose that we (I suppose I actually mean Bruce) start maintaining

Actually, Tom Lane runs pgindent usually now. I do the copyright
change, but I don't think we would ignore those since the single-line
change is probably something we would want to blame.

> our own file for this in git. It can be configured to run without any
> extra steps via a once-off "git config blame.ignoreRevsFile
> .git-blame-ignore-revs". It would only need to be updated whenever
> Bruce or Tom runs pgindent.
>
> It doesn't matter if this misses one or two smaller pgindent runs, it
> seems. Provided the really huge ones are in the file, everything works
> very well.

It would certainly be very easy to pull pgindent commits out of git log
and add them. I do wish we could cause everyone to honor that file, but
it seems each user has to configure their repository to honor it.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-03-18 21:14:03 Re: GROUP BY DISTINCT
Previous Message Michael Paquier 2021-03-18 21:08:29 Re: a verbose option for autovacuum