threads / discuss / 18697

Whitespace options

Subject: Whitespace options

## tl;dr

3 messages between Apr 2, 2009 and Apr 3, 2009.

replies: 2people: 3as markdown or json

Gerd Knops· Apr 2, 2009, 19:18 UTC · lore
Hi all,

I think there should be a whitespace option that ignores lines that consists completely of whitespace vs lines with actual trailing whitespace preceded by non-whitespace.

The reason is that many editors (especially those supporting indent- based code folding) keep 'empty' lines at the current indentation level. git (with default settings) flags all those lines.

I know I could just remove 'trailing-space' from 'core.whitespace', but I would actually still like be notified about the case where a line that is not whitespace only ends with trailing whitespace.

Thanks
Gerd
Joshua Juran· Apr 3, 2009, 02:15 UTC · re: Gerd Knops · lore

Re: Whitespace options

On Apr 2, 2009, at 12:18 PM, Gerd Knops wrote:
> I think there should be a whitespace option that ignores lines that  
> consists completely of whitespace vs lines with actual trailing  
> whitespace preceded by non-whitespace.
+1
> The reason is that many editors (especially those supporting indent- 
> based code folding) keep 'empty' lines at the current indentation  
> level.
As do some users, out of personal preference.
Josh
Miles Bader· Apr 3, 2009, 02:39 UTC · re: Gerd Knops · lore

Re: Whitespace options

Gerd Knops <gerti-git@bitart.com> writes:
> The reason is that many editors (especially those supporting indent-
> based code folding) keep 'empty' lines at the current indentation
> level. git (with default settings) flags all those lines.

That sounds like very fragile behavior on the part of the editor -- it sounds like they assume that all source code was created by their editor, and will never be touched by any other tool...

-Miles
-- 
Suburbia: where they tear out the trees and then name streets after them.

← back to recent threads