wsfix alias
- From
Andreas Ericsson <ae@op5.se>
- Date
- Jul 9, 2009, 20:54 UTC
- Message-ID
- <4A56590F.9050206@op5.se>
- In-Reply-To
- <20090709160249.GA12830@cthulhu>
Larry D'Anna wrote:
Show 8 quoted lines
> * Andreas Ericsson (ae@op5.se) [090709 03:04]: >> I do have one alias, which is "wsfix". It fixes whitespace fsckups I've >> added to the index but not yet committed to the worktree. It's not a >> particularly complex one, but not exactly simple either. > > oooh, i can has? > > --larry
These are quite stupid and can lose data for you. Please use with some care. Oh, and I lied. I have two aliases. wsfixi is the one that applies staged stuff. wsfix fixes all whitespace errors since the last commit and stages all changes in the index. Again, use with care, and don't hang me if they break your day ;-)
Mind the wrapping if your mua does things like that.
[alias] wsfix = !git diff HEAD >P.diff && git reset --hard && git apply --whitespace=fix P.diff && rm -f P.diff wsfixi = !git diff --cached >P.diff && git reset && git apply --whitespace=fix P.diff && rm -f P.diff
-- Andreas Ericsson andreas.ericsson@op5.se OP5 AB www.op5.se Tel: +46 8-230225 Fax: +46 8-230231 Considering the successes of the wars on alcohol, poverty, drugs and terror, I think we should give some serious thought to declaring war on peace.