Re: git diff --check whitespace checks, gitattributes - Mailing list pgsql-hackers

From Tom Lane
Subject Re: git diff --check whitespace checks, gitattributes
Date
Msg-id 14194.1383708674@sss.pgh.pa.us
Whole thread Raw
In response to git diff --check whitespace checks, gitattributes  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: git diff --check whitespace checks, gitattributes  (Peter Eisentraut <peter_e@gmx.net>)
Re: git diff --check whitespace checks, gitattributes  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> Attached is a patch that
> - Adds a .gitattributes file to configure appropriate whitespace checks
> for git diff --check.

> - Cleans up all whitespace errors found in this way in existing code.
> Most of that is in files not covered by pgindent, some in new code since
> the last pgindent.

> This makes the entire tree git diff --check clean.  After this, future
> patches can be inspected for whitespace errors with git diff --check,
> something that has been discussed on occasion.

I always (well, almost always) do git diff --check, so making it stronger
sounds good to me.  But it sounds like this still leaves it to the
committer to remember to run it.  Can we do anything about that?

> One open question is whether psql output pasted into documentation, in
> particular .sgml files, should preserve the trailing whitespace that
> psql produces.  This is currently done inconsistently.

> My preference is to trim the trailing whitespace, because otherwise it's
> impossible to check for trailing whitespace errors in other parts of
> those files.

Maybe we should think about fixing psql to not generate that whitespace.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: git diff --check whitespace checks, gitattributes
Next
From: Alvaro Herrera
Date:
Subject: Re: git diff --check whitespace checks, gitattributes