{"thread":{"id":"3510","subject":"git-annotate dies when a patch is missing trailing newline","startedAt":"2006-03-02T00:53:21Z","lastAt":"2006-03-02T04:10:11Z","messageCount":7,"participants":["Martin Langhoff","Ryan Anderson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"17002","messageId":"46a038f90603011653l7956d5dat99d88a7da98d21b6@mail.gmail.com","threadId":"3510","inReplyTo":null,"subject":"git-annotate dies when a patch is missing trailing newline","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-03-02T00:53:21Z","receivedAt":"2006-03-02T00:53:21Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"Ryan, (& list)\n\ngit-annotate is dying when a patch is missing trailing newline. There\n_are_ valid situations where code files are not expected to have\ntrailing newlines. Just thing of that glorious programming language,\nPHP.\n\n(Ducks).\n\nActually, 99% of my usage of git is tracking CVS projects so this is a\nbit of a problem.\n\nI had fixed it in Johannes version, but I'm lost as to where to fix it\nin the current git-annotate. Help?\n\n\nmartin\n"},{"id":"17004","messageId":"20060302015303.GA27871@mythryan2.michonline.com","threadId":"3510","inReplyTo":"46a038f90603011653l7956d5dat99d88a7da98d21b6@mail.gmail.com","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2006-03-02T01:53:04Z","receivedAt":"2006-03-02T01:53:04Z","isPatch":false,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"On Thu, Mar 02, 2006 at 01:53:21PM +1300, Martin Langhoff wrote:\n> Ryan, (& list)\n> \n> git-annotate is dying when a patch is missing trailing newline. There\n> _are_ valid situations where code files are not expected to have\n> trailing newlines. Just thing of that glorious programming language,\n> PHP.\n> \n> (Ducks).\n> \n> Actually, 99% of my usage of git is tracking CVS projects so this is a\n> bit of a problem.\n> \n> I had fixed it in Johannes version, but I'm lost as to where to fix it\n> in the current git-annotate. Help?\n\nCan you point me at a tree that has this problem?  I'll see what I can\ndo about fixing it tonight.\n\n-- \n\nRyan Anderson\n  sometimes Pug Majere\n"},{"id":"17005","messageId":"7vwtfdd2fu.fsf@assigned-by-dhcp.cox.net","threadId":"3510","inReplyTo":"20060302015303.GA27871@mythryan2.michonline.com","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-02T02:07:33Z","receivedAt":"2006-03-02T02:07:33Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ryan Anderson <ryan@michonline.com> writes:\n\n>> git-annotate is dying when a patch is missing trailing newline. There\n>> _are_ valid situations where code files are not expected to have\n>> trailing newlines. Just thing of that glorious programming language,\n>> PHP.\n>\n> Can you point me at a tree that has this problem?  I'll see what I can\n> do about fixing it tonight.\n\n$ cat script\n#!/bin/sh\n\nmkdir test-dir || exit\ncd test-dir\ngit init-db\necho 'A quick brown fox jumps over the' >file\necho 'lazy dog' | tr -d '\\012' >>file\ngit add file\ngit commit -a -m 'Initial.'\necho 'A quick brown fox\njumps over the' >file\necho 'lazy dog' | tr -d '\\012' >>file\ngit commit -a -m 'Second.'\n\ngit annotate file\n$ rm -fr test-dir\n$ sh script\ndefaulting to local storage area\nCommitting initial tree 2850f9a320885b57bb410baffe972b19b17e9270\nUse of uninitialized value in string ne at /home/junio/bin/Linux/git-annotate line 308, <$kid> line 10.\nUse of uninitialized value in sprintf at /home/junio/bin/Linux/git-annotate line 309, <$kid> line 10.\nLine 3 (3) does not match:\n| No newline at end of file\n|\n1e698bcc5b142b542bf99a1a6f17864bc709dbf5 => 780bca516444e94219d4158b7fea97e763dcee6e\n$ echo $?\n9\n$ exit\n"},{"id":"17006","messageId":"7vslq1d1pr.fsf@assigned-by-dhcp.cox.net","threadId":"3510","inReplyTo":"46a038f90603011653l7956d5dat99d88a7da98d21b6@mail.gmail.com","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-02T02:23:12Z","receivedAt":"2006-03-02T02:23:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n\n> git-annotate is dying when a patch is missing trailing newline. There\n> _are_ valid situations where code files are not expected to have\n> trailing newlines. Just thing of that glorious programming language,\n> PHP.\n\nDoes this help?\n\n---\ndiff --git a/git-annotate.perl b/git-annotate.perl\nindex f9c2c6c..d30eba7 100755\n--- a/git-annotate.perl\n+++ b/git-annotate.perl\n@@ -304,6 +304,10 @@ sub _git_diff_parse {\n \t\t\t}\n \t\t\t$ri++;\n \n+\t\t} elsif (m/^\\\\/) {\n+\t\n+\t\t\t; # ignore for now...\n+\n \t\t} else {\n \t\t\tif (substr($_,1) ne get_line($slines,$ri) ) {\n \t\t\t\tdie sprintf(\"Line %d (%d) does not match:\\n|%s\\n|%s\\n%s => %s\\n\",\n"},{"id":"17007","messageId":"46a038f90603011907h6d0d4450w426afb9ada33ddb0@mail.gmail.com","threadId":"3510","inReplyTo":"7vslq1d1pr.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-03-02T03:07:00Z","receivedAt":"2006-03-02T03:07:00Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 3/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n>\n> > git-annotate is dying when a patch is missing trailing newline. There\n> > _are_ valid situations where code files are not expected to have\n> > trailing newlines. Just thing of that glorious programming language,\n> > PHP.\n>\n> Does this help?\n\nYes, excellent! BTW, I just realized that git-cvsserver is in master,\nbut the \"git-annotate -S\" patch isn't there, so cvs annotate dies. Is\nanything holding the patch back in next?\n\ncheers,\n\n\nmartin\n"},{"id":"17008","messageId":"7voe0pcy9c.fsf@assigned-by-dhcp.cox.net","threadId":"3510","inReplyTo":"46a038f90603011907h6d0d4450w426afb9ada33ddb0@mail.gmail.com","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-02T03:37:51Z","receivedAt":"2006-03-02T03:37:51Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n\n> Yes, excellent! BTW, I just realized that git-cvsserver is in master,\n> but the \"git-annotate -S\" patch isn't there, so cvs annotate dies. Is\n> anything holding the patch back in next?\n\nIs -S in next?\n"},{"id":"17010","messageId":"46a038f90603012010u2efaee26lef6cd95412fb47cb@mail.gmail.com","threadId":"3510","inReplyTo":"7voe0pcy9c.fsf@assigned-by-dhcp.cox.net","subject":"Re: git-annotate dies when a patch is missing trailing newline","fromName":"Martin Langhoff","fromEmail":"martin.langhoff@gmail.com","sentAt":"2006-03-02T04:10:11Z","receivedAt":"2006-03-02T04:10:11Z","isPatch":false,"sender":{"key":"martin.langhoff@gmail.com","avatar":"https://gravatar.com/avatar/1e3f311b6c4c15836501901ca58f8c0b0667246488084ba524d8bc9867e22fd9?d=mp&s=160"},"body":"On 3/2/06, Junio C Hamano <junkio@cox.net> wrote:\n> \"Martin Langhoff\" <martin.langhoff@gmail.com> writes:\n>\n> > Yes, excellent! BTW, I just realized that git-cvsserver is in master,\n> > but the \"git-annotate -S\" patch isn't there, so cvs annotate dies. Is\n> > anything holding the patch back in next?\n>\n> Is -S in next?\n\nYes, but broken since it switched to Getopt::Long (grumble...). Patch\nshould be hitting the list now, you can also pull it from my repo.\n\ncheers,\n\n\nmartin\n"}]}