Skip to contentSkip to conversation

whitespace checking in git-add?

DISCUSSION Chris Frey 3 participants 5 messages Jun 15, 2016

lore
Share & tools
lore

Chris Frey

author
#0 lore raw

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

#1 lore raw
Quoted 4 lines · Chris Frey

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

#3 lore raw
Quoted 8 lines · Sverre Rabbelier

Heya,

Quoted 1 line · Nicolas Pitre

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

#4 lore raw

Heya,

Quoted 9 lines · Nicolas Pitre
Quoted 6 lines · Sverre Rabbelier
Quoted 1 line · Nicolas Pitre

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 :).

Signature · 3 lines
Cheers,

Sverre Rabbelier