How do I get git-format-patch to ignore changes that remove spaces from the end of the line?

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

 



I have configured my text editor to remove spaces at the end of each line whenever it saves a file. I do this so that I don't inadvertently add spaces to the end of any line.

Unfortunately, if the file *already* had spaces at the end of some lines before I start editing it, this spaces will also be removed.

After I commit my changes, I use git-format-patch to make a patch. I then get deltas like this:

  * Copyright (C) 1996-2005 Paul Mackerras.
- *
+ *
  *  Adapted for 64bit PowerPC by Dave Engebretsen and Peter Bergner.
- *    {engebret|bergner}@us.ibm.com
+ *    {engebret|bergner}@us.ibm.com
  *

I don't want these deltas in my patch. However, if I specify an option like --ignore-all-space, git-format-patch omits deltas like this one:

-               memcpy(fs_enet_data.macaddr, mac_addr, 6);
+                       memcpy(fs_enet_data.macaddr, mac_addr, 6);

In this case, I *do* want the delta, because I'm indenting a line to fix a formatting error.

So how do I get the output that I want, and not the output that I don't want?

--
Timur Tabi
Linux Kernel Developer @ Freescale
-
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]