Re: git apply/am whitespace errors

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

 



neubyr <neubyr@xxxxxxxxx> writes:

> I am getting  following error while applying a patch using git-apply.
>
> {{{
> /tmp/patches/ticket11/0002-Commit-for-ticket-11.patch:51: new blank line at EOF.
> }}}
>
> What does number '51' after colon ':' indicate?

Looks like "apply --whitespace=error" is not reporting the optimal line
number for the blank at EOF case.

It ideally should point at the line number of the offending patch in the
input patch file (i.e. "cat -n .git/apply-rebase/patch" would show the "+"
line that adds a blank line on 51th line), but it seems that it instead
points at the beginning of the hunk that introduces the issue.

E.g. if we add an empty line at the end of COPYING (which is 360 lines
long), we would get a patch file that looks like this:

     1	diff --git a/COPYING b/COPYING$
     2	index 536e555..ccf4c7f 100644$
     3	--- a/COPYING$
     4	+++ b/COPYING$
     5	@@ -358,3 +358,4 @@ proprietary programs.  If your program is a subroutine library, you may$
     6	 consider it more useful to permit linking proprietary applications with the$
     7	 library.  If this is what you want to do, use the GNU Lesser General$
     8	 Public License instead of this License.$
     9	+$

and "git apply --whitespace=error P.diff" would report the hunk that
begins at line 5 is wrong:

     P.diff:5: new blank line at EOF.
     +
     fatal: 1 line adds whitespace errors.

when the true offending line is at line #9.
--
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]