# [PATCH 0/3] Fix assorted white space damage

6 messages from 2007-05-12 to 2007-05-13. Participants: Marco Costalba, Junio C Hamano, Johannes Schindelin.
Thread: https://gitlist.dev/t/8102

## Marco Costalba, 2007-05-12 11:09

Subject: [PATCH 0/3] Fix assorted white space damage
Message-ID: <e5bfff550705120409v629425aesc910927c26871323@mail.gmail.com>
URL: https://gitlist.dev/e/e5bfff550705120409v629425aesc910927c26871323%40mail.gmail.com

```
Following there is a 3  patch series to remove stealth whitespace.

I have used the new 'cleanfile' script by H. Peter Anvin, just merged
in Linux tree.

The script cleans up various classes of stealth whitespace.  In
particular, it cleans up:

  - Whitespace (spaces or tabs)before newline;
  - DOS line endings (CR before LF);
  - Space before tab (spaces are deleted or converted to tabs);
  - Empty lines at end of file.


Tested with

make
make install
make test


  Marco

```

## Junio C Hamano, 2007-05-12 20:45

Subject: Re: [PATCH 0/3] Fix assorted white space damage
Message-ID: <7vhcqhwz2n.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vhcqhwz2n.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <e5bfff550705120409v629425aesc910927c26871323@mail.gmail.com>

```
Allow me to chuck these at this moment.  Could you redo this as
the first thing after v1.5.2 final, please?

```

## Junio C Hamano, 2007-05-13 01:45

Subject: Re: [PATCH 0/3] Fix assorted white space damage
Message-ID: <7vzm49ts2f.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vzm49ts2f.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <e5bfff550705120409v629425aesc910927c26871323@mail.gmail.com>

```
"Marco Costalba" <mcostalba@gmail.com> writes:

> Following there is a 3  patch series to remove stealth whitespace.
>
> I have used the new 'cleanfile' script by H. Peter Anvin, just merged
> in Linux tree.
>
> The script cleans up various classes of stealth whitespace.  In
> particular, it cleans up:
>
>  - Whitespace (spaces or tabs)before newline;
>  - DOS line endings (CR before LF);
>  - Space before tab (spaces are deleted or converted to tabs);
>  - Empty lines at end of file.

I haven't checked the script, but "git-apply --whitespace=strip"
can be used to do pretty much the same job with this sequence,
except the last one (do it with a copy of repository if you do
not want "git clean -x" to lose untracked):


	$ git checkout master
        $ rm -f .git/index
        $ git checkout HEAD -- t/
        $ git clean -x -d
	$ git diff -R --binary HEAD >P.diff
        $ git apply --index --whitespace=strip P.diff

Then you can check the results, and make a commit.

In the above I explicitly "saved" t/ because we have some test
vectors that need to have trailing whitespaces.

```

## Marco Costalba, 2007-05-13 03:29

Subject: Re: [PATCH 0/3] Fix assorted white space damage
Message-ID: <e5bfff550705122029s2066ec0bwfebfec844a08dc3c@mail.gmail.com>
URL: https://gitlist.dev/e/e5bfff550705122029s2066ec0bwfebfec844a08dc3c%40mail.gmail.com
In-Reply-To: <7vhcqhwz2n.fsf@assigned-by-dhcp.cox.net>

```
On 5/12/07, Junio C Hamano <junkio@cox.net> wrote:
> Allow me to chuck these at this moment.  Could you redo this as
> the first thing after v1.5.2 final, please?
>
>

Ok. I will be off-line for the next week.

I will redo when coming back.


   Marco

```

## Johannes Schindelin, 2007-05-13 10:31

Subject: Re: [PATCH 0/3] Fix assorted white space damage
Message-ID: <Pine.LNX.4.64.0705131230230.6410@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0705131230230.6410%40racer.site
In-Reply-To: <7vzm49ts2f.fsf@assigned-by-dhcp.cox.net>

```
Hi,

On Sat, 12 May 2007, Junio C Hamano wrote:

> In the above I explicitly "saved" t/ because we have some test vectors 
> that need to have trailing whitespaces.

AFAICT the documentation has trailing whitespace also, to indicate that 
the paragraph does not end here. Correct me if I'm wrong, and these 
trailing whitespaces are not necessary.

Ciao,
Dscho

```

## Junio C Hamano, 2007-05-13 18:57

Subject: Re: [PATCH 0/3] Fix assorted white space damage
Message-ID: <7vk5vcsg9u.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vk5vcsg9u.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <Pine.LNX.4.64.0705131230230.6410@racer.site>

```
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> AFAICT the documentation has trailing whitespace also, to indicate that 
> the paragraph does not end here. Correct me if I'm wrong, and these 
> trailing whitespaces are not necessary.

Thanks for the tip --- I did not know about deliberate trailing
whitespaces there.

It should be easy to verify by comparing the build products
before and after trailing whitespace removal, so I will try to
remember doing that.

```
