Re: [PATCH] add a trivial patch style checker

Jan Engelhardt
2007-05-30T16:11:24Z

On May 30 2007 08:33, Randy Dunlap wrote:
>> > That's just a joe bug then.
>> >
>> > diff no longer requires a beginning space, at least in the testing
>> > that I did it worked with no leading space on a label:.
>>
>> But not everyone runs the latest and greatest. diffutils 2.8.7
>> takes /^label:/ as a marker for the @@ line.
>
> OK. What does "marker for the @@ line" mean?

if ($_ !~ /^[\(\[\{]/ && $_ =~ /^(\S+)/) {
print "@@ -a,b +c,d @@ $1\n"
}

So
label:
will be the 'mark[er]' for the @@ line

Just try yourself:
<<< foo.c <<<
int main(void)
{
x
y
z
label:
a
b
c
d
e
f
}
>>>
<<< foo2.c <<<
int main(void)
{
x
y
z
label:
a
b
c
d
d+
e
f
}
>>>
<<< diff -dpru foo.c foo2.c <<<
--- foo.c 2007-05-30 10:33:45.714222656 +0200
+++ foo2.c 2007-05-30 18:03:43.061471495 +0200
@@ -8,6 +8,7 @@ label:
b
c
d
+ d+
e
f
}
>>>

Jan
--