git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-annotate dies when a patch is missing trailing newline

From
Junio C Hamano <junkio@cox.net>
Date
Mar 2, 2006, 02:23 UTC
Message-ID
<7vslq1d1pr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<46a038f90603011653l7956d5dat99d88a7da98d21b6@mail.gmail.com>
"Martin Langhoff" <martin.langhoff@gmail.com> 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",
Previous: Junio C HamanoNext: Martin Langhoff
Message 4 of 7 in “git-annotate dies when a patch is missing trailing newline”
  1. Martin LanghoffMar 2, 2006
  2. Ryan AndersonMar 2, 2006
  3. Junio C HamanoMar 2, 2006
  4. Junio C HamanoMar 2, 2006
  5. Martin LanghoffMar 2, 2006
  6. Junio C HamanoMar 2, 2006
  7. Martin LanghoffMar 2, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.