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:07 UTC
Message-ID
<7vwtfdd2fu.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060302015303.GA27871@mythryan2.michonline.com>
Ryan Anderson <ryan@michonline.com> writes:
Show 7 quoted lines
>> 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.
>
> Can you point me at a tree that has this problem?  I'll see what I can
> do about fixing it tonight.

$ cat script #!/bin/sh

mkdir test-dir || exit cd test-dir git init-db echo 'A quick brown fox jumps over the' >file echo 'lazy dog' | tr -d '\012' >>file git add file git commit -a -m 'Initial.' echo 'A quick brown fox jumps over the' >file echo 'lazy dog' | tr -d '\012' >>file git commit -a -m 'Second.'

git annotate file
$ rm -fr test-dir
$ sh script
defaulting to local storage area
Committing initial tree 2850f9a320885b57bb410baffe972b19b17e9270
Use of uninitialized value in string ne at /home/junio/bin/Linux/git-annotate line 308, <$kid> line 10.
Use of uninitialized value in sprintf at /home/junio/bin/Linux/git-annotate line 309, <$kid> line 10.
Line 3 (3) does not match:
| No newline at end of file
|
1e698bcc5b142b542bf99a1a6f17864bc709dbf5 => 780bca516444e94219d4158b7fea97e763dcee6e
$ echo $?
9
$ exit
Previous: Ryan AndersonNext: Junio C Hamano
Message 3 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.