From: Junio C Hamano <gitster@pobox.com>
To: "Kenneth P. Turvey" <kt-usenet@squeakydolphin.com>
Cc: git@vger.kernel.org
Subject: Re: Whitespace on commit
Date: Wed, 12 Mar 2008 20:52:06 -0700 [thread overview]
Message-ID: <7viqzr1dsp.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <fra7ji$7p9$1@ger.gmane.org> (Kenneth P. Turvey's message of "Thu, 13 Mar 2008 03:38:26 +0000 (UTC)")
"Kenneth P. Turvey" <kt-usenet@squeakydolphin.com> 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
next prev parent reply other threads:[~2008-03-13 3:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-13 3:38 Whitespace on commit Kenneth P. Turvey
2008-03-13 3:52 ` Junio C Hamano [this message]
2008-03-13 7:34 ` Andreas Ericsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7viqzr1dsp.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kt-usenet@squeakydolphin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).