Skip Menu |

This queue is for tickets about the Text-Diff-Parser CPAN distribution.

Report information
The Basics
Id: 23955
Status: resolved
Priority: 0/
Queue: Text-Diff-Parser

People
Owner: Nobody in particular
Requestors: nelhage [...] mit.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



CC: gwyn [...] cpan.org
Subject: Parsing of linux kernel unified diffs
Date: Sat, 16 Dec 2006 00:40:02 -0500
To: bug-text-diff-parser [...] rt.cpan.org
From: Nelson Elhage <nelhage [...] MIT.EDU>
In attempting to use Text::Diff::Parser to parse patches to the linux kernel taken from kernel.org, I've run into some bugs in its diff parsing. The attached diff appears to contain two features it is unable to handle. First: The filename lines (e.g --- a/kernel/sys.c) don't contain either a date or a revision after the filename. Second: The @@ line contains the C function the diff occurred in after the lines (@@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, un) T::D::P appears to be unable to handle either feature of the unified diff; As-is, it reports it to be a zero-change diff; If dates or revisions are added, it reports a parser error looking for the @@ line. - Nelson Elhage ============================= --- a/kernel/sys.c +++ b/kernel/sys.c @@ -1983,7 +1983,7 @@ asmlinkage long sys_prctl(int option, uno error = current->mm->dumpable; break; case PR_SET_DUMPABLE: - if (arg2 < 0 || arg2 > 2) { + if (arg2 < 0 || arg2 > 1) { error = -EINVAL; break; } ============================= (Diff taken from http://www.kernel.org/git/?p=linux/kernel/git/stable/linux-2.6.19.y.git;a=commitdiff_plain;h=abf75a5033d4da7b8a7e92321d74021d1fcfb502;hp=b2d6744849b5bf6b4593b81c136772df7a238ac9 )
Thank you for the bug report. I used diffs produced by the diff on my system to test. I wasn't aware of the variations that kernel.org seems to be using. Maybe I should poke around the source code for patch to get more tests. -Philip
Hello, I've just uploaded 0.05 to PAUSE, which handles the diff you sent me as a test case. If you would be so kind as to verify that other kernel.org diffs can be parsed, I will close this ticket. -Philip
It looks good on the ones I've tested. Thanks for the prompt response! - Nelson On Tue Dec 19 08:56:30 2006, GWYN wrote: Show quoted text
> Hello, > > I've just uploaded 0.05 to PAUSE, which handles the diff you sent me as > a test case. > > If you would be so kind as to verify that other kernel.org diffs can be > parsed, I will close this ticket. > > -Philip