git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-annotate dies when a patch is missing trailing newline
@ 2006-03-02  0:53 Martin Langhoff
  2006-03-02  1:53 ` Ryan Anderson
  2006-03-02  2:23 ` Junio C Hamano
  0 siblings, 2 replies; 7+ messages in thread
From: Martin Langhoff @ 2006-03-02  0:53 UTC (permalink / raw)
  To: Git Mailing List, Ryan Anderson

Ryan, (& list)

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.

(Ducks).

Actually, 99% of my usage of git is tracking CVS projects so this is a
bit of a problem.

I had fixed it in Johannes version, but I'm lost as to where to fix it
in the current git-annotate. Help?


martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  0:53 git-annotate dies when a patch is missing trailing newline Martin Langhoff
@ 2006-03-02  1:53 ` Ryan Anderson
  2006-03-02  2:07   ` Junio C Hamano
  2006-03-02  2:23 ` Junio C Hamano
  1 sibling, 1 reply; 7+ messages in thread
From: Ryan Anderson @ 2006-03-02  1:53 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Git Mailing List

On Thu, Mar 02, 2006 at 01:53:21PM +1300, Martin Langhoff wrote:
> Ryan, (& list)
> 
> 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.
> 
> (Ducks).
> 
> Actually, 99% of my usage of git is tracking CVS projects so this is a
> bit of a problem.
> 
> I had fixed it in Johannes version, but I'm lost as to where to fix it
> in the current git-annotate. Help?

Can you point me at a tree that has this problem?  I'll see what I can
do about fixing it tonight.

-- 

Ryan Anderson
  sometimes Pug Majere

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  1:53 ` Ryan Anderson
@ 2006-03-02  2:07   ` Junio C Hamano
  0 siblings, 0 replies; 7+ messages in thread
From: Junio C Hamano @ 2006-03-02  2:07 UTC (permalink / raw)
  To: Ryan Anderson; +Cc: git

Ryan Anderson <ryan@michonline.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.
>
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  0:53 git-annotate dies when a patch is missing trailing newline Martin Langhoff
  2006-03-02  1:53 ` Ryan Anderson
@ 2006-03-02  2:23 ` Junio C Hamano
  2006-03-02  3:07   ` Martin Langhoff
  1 sibling, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2006-03-02  2:23 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: git

"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",

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  2:23 ` Junio C Hamano
@ 2006-03-02  3:07   ` Martin Langhoff
  2006-03-02  3:37     ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Martin Langhoff @ 2006-03-02  3:07 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 3/2/06, Junio C Hamano <junkio@cox.net> wrote:
> "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?

Yes, excellent! BTW, I just realized that git-cvsserver is in master,
but the "git-annotate -S" patch isn't there, so cvs annotate dies. Is
anything holding the patch back in next?

cheers,


martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  3:07   ` Martin Langhoff
@ 2006-03-02  3:37     ` Junio C Hamano
  2006-03-02  4:10       ` Martin Langhoff
  0 siblings, 1 reply; 7+ messages in thread
From: Junio C Hamano @ 2006-03-02  3:37 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: git

"Martin Langhoff" <martin.langhoff@gmail.com> writes:

> Yes, excellent! BTW, I just realized that git-cvsserver is in master,
> but the "git-annotate -S" patch isn't there, so cvs annotate dies. Is
> anything holding the patch back in next?

Is -S in next?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: git-annotate dies when a patch is missing trailing newline
  2006-03-02  3:37     ` Junio C Hamano
@ 2006-03-02  4:10       ` Martin Langhoff
  0 siblings, 0 replies; 7+ messages in thread
From: Martin Langhoff @ 2006-03-02  4:10 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On 3/2/06, Junio C Hamano <junkio@cox.net> wrote:
> "Martin Langhoff" <martin.langhoff@gmail.com> writes:
>
> > Yes, excellent! BTW, I just realized that git-cvsserver is in master,
> > but the "git-annotate -S" patch isn't there, so cvs annotate dies. Is
> > anything holding the patch back in next?
>
> Is -S in next?

Yes, but broken since it switched to Getopt::Long (grumble...). Patch
should be hitting the list now, you can also pull it from my repo.

cheers,


martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-03-02  4:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-02  0:53 git-annotate dies when a patch is missing trailing newline Martin Langhoff
2006-03-02  1:53 ` Ryan Anderson
2006-03-02  2:07   ` Junio C Hamano
2006-03-02  2:23 ` Junio C Hamano
2006-03-02  3:07   ` Martin Langhoff
2006-03-02  3:37     ` Junio C Hamano
2006-03-02  4:10       ` Martin Langhoff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).