# whitespace checking in git-add?

5 messages from 2009-02-20 to 2009-02-21. Participants: Chris Frey, Nicolas Pitre, Sverre Rabbelier.
Thread: https://gitlist.dev/t/17927

## Chris Frey, 2009-02-20 23:04

Subject: whitespace checking in git-add?
Message-ID: <20090220230454.GA10112@foursquare.net>
URL: https://gitlist.dev/e/20090220230454.GA10112%40foursquare.net

```
Hi,

Is it possible to somehow enable whitespace checking during git-add?
In my searches, I can only seem to find mention of it in git-diff.

Thanks,
- Chris

```

## Nicolas Pitre, 2009-02-21 02:14

Subject: Re: whitespace checking in git-add?
Message-ID: <alpine.LFD.2.00.0902202109010.5511@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0902202109010.5511%40xanadu.home
In-Reply-To: <20090220230454.GA10112@foursquare.net>

```
On Fri, 20 Feb 2009, Chris Frey wrote:

> Hi,
> 
> Is it possible to somehow enable whitespace checking during git-add?
> In my searches, I can only seem to find mention of it in git-diff.

One thing you can do is:

 1) 'git add' and 'git commit' as usual

 2) run 'git rebase -f --whitespace=fix HEAD~'


Nicolas

```

## Sverre Rabbelier, 2009-02-21 11:21

Subject: Re: whitespace checking in git-add?
Message-ID: <fabb9a1e0902210321k6bdd8726jea7c930a5a61cce5@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0902210321k6bdd8726jea7c930a5a61cce5%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.00.0902202109010.5511@xanadu.home>

```
Heya,

On Sat, Feb 21, 2009 at 03:14, Nicolas Pitre <nico@cam.org> wrote:
>  2) run 'git rebase -f --whitespace=fix HEAD~'

Thanks for the plug ;), but you should note that that only works on a
very recent git. It's not even in master yet, according to [0] it's
been in next for only 7 days.

[0] http://repo.or.cz/w/git.git?a=search&h=refs/heads/next&st=commit&s=srabbelier

-- 
Cheers,

Sverre Rabbelier

```

## Nicolas Pitre, 2009-02-21 19:26

Subject: Re: whitespace checking in git-add?
Message-ID: <alpine.LFD.2.00.0902211424490.5511@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0902211424490.5511%40xanadu.home
In-Reply-To: <fabb9a1e0902210321k6bdd8726jea7c930a5a61cce5@mail.gmail.com>

```
On Sat, 21 Feb 2009, Sverre Rabbelier wrote:

> Heya,
> 
> On Sat, Feb 21, 2009 at 03:14, Nicolas Pitre <nico@cam.org> wrote:
> >  2) run 'git rebase -f --whitespace=fix HEAD~'
> 
> Thanks for the plug ;), but you should note that that only works on a
> very recent git. It's not even in master yet, according to [0] it's
> been in next for only 7 days.

Oh, OK...  Still better than a non existing feature.


Nicolas

```

## Sverre Rabbelier, 2009-02-21 19:40

Subject: Re: whitespace checking in git-add?
Message-ID: <fabb9a1e0902211140l7f3671bt2d175f36300ded7b@mail.gmail.com>
URL: https://gitlist.dev/e/fabb9a1e0902211140l7f3671bt2d175f36300ded7b%40mail.gmail.com
In-Reply-To: <alpine.LFD.2.00.0902211424490.5511@xanadu.home>

```
Heya,

On Sat, Feb 21, 2009 at 20:26, Nicolas Pitre <nico@cam.org> wrote:
> On Sat, 21 Feb 2009, Sverre Rabbelier wrote:
>> On Sat, Feb 21, 2009 at 03:14, Nicolas Pitre <nico@cam.org> wrote:
>> >  2) run 'git rebase -f --whitespace=fix HEAD~'
>>
>> Thanks for the plug ;), but you should note that that only works on a
>> very recent git. It's not even in master yet, according to [0] it's
>> been in next for only 7 days.
>
> Oh, OK...  Still better than a non existing feature.

That's true :). Btw, it's also possible to do:
$ git rebase --whitespace=fix HEAD~

The --whitespace=fix will automagically turn on the -f :).

-- 
Cheers,

Sverre Rabbelier

```
