Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Alvaro Herrera
Tom Lane wrote: > (Actually I tend to pgindent stuff before committing, these > days, but sometimes that's impractical because somebody's already > committed some not-well-indented stuff elsewhere in the same file.) What I normally do is commit the changes, then pgindent, then manually review the

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Tom Lane
Andrew Dunstan writes: > Personally I don't get the mania about trailing whitespace, but maybe > that's just me. For me, it's an easily-checked thing that will reduce pgindent noise later. (Actually I tend to pgindent stuff before committing, these days, but sometimes that's impractical because

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Tom Lane
Peter Eisentraut writes: > On 11/5/13, 10:31 PM, Tom Lane wrote: >> Maybe we should think about fixing psql to not generate that whitespace. > Not easy, see > http://www.postgresql.org/message-id/1285093687.5468.18.ca...@vanquo.pezone.net Ah, thanks for the reminder. One killer point in that di

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Andrew Dunstan
On 11/05/2013 10:31 PM, Tom Lane wrote: Peter Eisentraut 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

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Peter Eisentraut
On 11/5/13, 11:17 PM, Alvaro Herrera wrote: > I think pasting psql output verbatim isn't such a great idea anyway. > Maybe it's okay for certain specific examples, but in most cases I think > it'd be better to produce native SGML tables instead of > stuff. After all, it's the result set that's in

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-06 Thread Peter Eisentraut
On 11/5/13, 10:31 PM, Tom Lane wrote: > 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? Sure, you could install an update hook on the se

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-05 Thread Alvaro Herrera
Peter Eisentraut wrote: > 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. +1 to this, and also +1 to Tom's suggestion of making it more strongly enforced

Re: [HACKERS] git diff --check whitespace checks, gitattributes

2013-11-05 Thread Tom Lane
Peter Eisentraut 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