Re: git add without whitespace

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

 



Robert Dailey <rcdailey.lists@xxxxxxxxx> 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.
--
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]