All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Robert Dailey <rcdailey.lists@gmail.com>
Cc: Git <git@vger.kernel.org>
Subject: Re: git add without whitespace
Date: Mon, 30 May 2016 15:00:44 -0700	[thread overview]
Message-ID: <xmqq8tyr8aur.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAHd499Drdt6GoScdksNNWLrsvG3Dex7fTYNhatL-qboCPW5RZQ@mail.gmail.com> (Robert Dailey's message of "Mon, 30 May 2016 14:50:05 -0500")

Robert Dailey <rcdailey.lists@gmail.com> writes:

> I like your solution better than mine because it utilizes the rules
> defined in .gitattributes.

A difference that may be more important is that I do not do
generation of a patch or application of it without ignoring
whitespaces with things like -w and --ignore-whitespace.  That way,
if my edit is a correction of existing whitespace breakage (e.g. I
noticed a line that is indented by 8 spaces, and I corrected it by
replacing them with one tab), that is shown as a change by "diff"
and kept in the result.  I suspect that your "diff -w | apply --ignore"
will ignore that manual fix?

> What does the checkout at the end do? That part confuses me (granted
> I'm not well-versed with bash script).

I correct whitespace-broken updates the user (i.e. I) made in her
working tree file by adding a corrected version to the index, and
then I checkout the result out of the index to the working tree.

That corrects the breakage in both the index and the working tree,
so that my further edit to the file will start from a ws-corrected
version.

  reply	other threads:[~2016-05-30 22: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 [this message]
2016-05-31 15:03       ` Robert Dailey
2016-05-31 16:16         ` Junio C Hamano
2016-05-31 15:59   ` Christian Neukirchen
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=xmqq8tyr8aur.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rcdailey.lists@gmail.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 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.