Re: Whitespace on commit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Kenneth P. Turvey" <kt-usenet@xxxxxxxxxxxxxxxxxx> writes:

> I keep getting annoying errors when I try to commit.  Git complains that I
> have whitespace in the wrong places.  
>
> This is fine.. I even like it.  What I don't like is having to change this
> stuff manually.  Is there anyway to tell git to just fix the stuff and do
> the commit?  
>
> I've tried setting
>
> apply.whitespace = fix 
>
> in my .gitconfig, but that doesn't seem to help when doing commits.

Yeah, that is to protect yourself from whitespace mess _other people_
threw at you in a patch form.

You can ask git to fix your own stuff up, by pretending that you are that
other person who made the mess, by doing:

	git diff HEAD >P.diff
        git reset --hard HEAD
        git apply --index --whitespace=fix P.diff

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux