All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Neukirchen <chneukirchen@gmail.com>
To: git@vger.kernel.org
Subject: Re: git add without whitespace
Date: Tue, 31 May 2016 17:59:45 +0200	[thread overview]
Message-ID: <87pos2tdzi.fsf@gmail.com> (raw)
In-Reply-To: <xmqqlh2r8ixu.fsf@gitster.mtv.corp.google.com> (Junio C. Hamano's message of "Mon, 30 May 2016 12:06:05 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Robert Dailey <rcdailey.lists@gmail.com> writes:
>
>> $ git diff -U0 -w --no-color | git apply --cached --ignore-whitespace
>> --unidiff-zero
>>
>> This command explicitly leaves out context because it can sometimes
>> cause the patch to fail to apply, I think due to whitespace being in
>> it, but I'm not completely sure myself.
>
> I have had this in my ~/.gitconfig for a long time.
>
> [alias]
> 	wsadd = "!sh -c 'git diff -- \"$@\" | git apply --cached --whitespace=fix;\
> 		git co -- ${1-.} \"$@\"' -"

Very useful, thanks for sharing!

I wonder which other gems are in your .gitconfig, is it public?

-- 
Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org

  parent reply	other threads:[~2016-05-31 16:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-30 15:26 git add without whitespace Robert Dailey
2016-05-30 19:06 ` Junio C Hamano
2016-05-30 19:50   ` Robert Dailey
2016-05-30 22:00     ` Junio C Hamano
2016-05-31 15:03       ` Robert Dailey
2016-05-31 16:16         ` Junio C Hamano
2016-05-31 15:59   ` Christian Neukirchen [this message]
2016-05-31 16:27   ` demerphq

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=87pos2tdzi.fsf@gmail.com \
    --to=chneukirchen@gmail.com \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.