From: Junio C Hamano Date: Thu, 02 Mar 2006 02:23:12 GMT Subject: Re: git-annotate dies when a patch is missing trailing newline Message-ID: <7vslq1d1pr.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <46a038f90603011653l7956d5dat99d88a7da98d21b6@mail.gmail.com> "Martin Langhoff" writes: > git-annotate is dying when a patch is missing trailing newline. There > _are_ valid situations where code files are not expected to have > trailing newlines. Just thing of that glorious programming language, > PHP. Does this help? --- diff --git a/git-annotate.perl b/git-annotate.perl index f9c2c6c..d30eba7 100755 --- a/git-annotate.perl +++ b/git-annotate.perl @@ -304,6 +304,10 @@ sub _git_diff_parse { } $ri++; + } elsif (m/^\\/) { + + ; # ignore for now... + } else { if (substr($_,1) ne get_line($slines,$ri) ) { die sprintf("Line %d (%d) does not match:\n|%s\n|%s\n%s => %s\n",