threads / discuss / 17927

whitespace checking in git-add?

Subject: whitespace checking in git-add?

## tl;dr

5 messages between Feb 20, 2009 and Feb 21, 2009.

replies: 4people: 3as markdown or json

Chris Frey· Feb 20, 2009, 23:04 UTC · lore
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· Feb 21, 2009, 02:14 UTC · re: Chris Frey · lore

Re: whitespace checking in git-add?

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· Feb 21, 2009, 11:21 UTC · re: Nicolas Pitre · lore

Re: whitespace checking in git-add?

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· Feb 21, 2009, 19:26 UTC · re: Sverre Rabbelier · lore

Re: whitespace checking in git-add?

On Sat, 21 Feb 2009, Sverre Rabbelier wrote:
Show 8 quoted lines
> 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· Feb 21, 2009, 19:40 UTC · re: Nicolas Pitre · lore

Re: whitespace checking in git-add?

Heya,
On Sat, Feb 21, 2009 at 20:26, Nicolas Pitre <nico@cam.org> wrote:
Show 9 quoted lines
> 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

← back to recent threads