Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Brandon Casey
On Tue, Jan 22, 2013 at 1:49 AM, Jonathan Nieder wrote: > Jonathan Nieder wrote: > >> Here is the loop in master: >> >> int hit = 0; >> [...] >> >> for (i = len - 1; i > 0; i--) { >> if (hit && buf[i] == '\n') >> break; >> hit = (buf[i]

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Jonathan Nieder
Jonathan Nieder wrote: > line) instead of buf[i] is a whitespace character. So for example, it > confuses the following for a well-formed RFC2822 footer: Luckily it doesn't, since the final continuation line is not followed by whitespace. I should have said: "... is a white

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Jonathan Nieder
Brandon Casey wrote: > On Mon, Jan 21, 2013 at 11:54 PM, Jonathan Nieder wrote: >>> - if ((buf[k] == ' ' || buf[k] == '\t') && !first) >>> - continue; >> >> This is always the first line examined, so this "continue" never >> triggers. > > This is just totally broke

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Jonathan Nieder
Jonathan Nieder wrote: > Here is the loop in master: > > int hit = 0; > [...] > > for (i = len - 1; i > 0; i--) { > if (hit && buf[i] == '\n') > break; > hit = (buf[i] == '\n'); > } > > I don't see any adjacency check. Of course

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Jonathan Nieder
Brandon Casey wrote: > On Mon, Jan 21, 2013 at 11:54 PM, Jonathan Nieder wrote: >> First (snipped), it seeks back two newlines from the end and then >> forward to the next non-newline character, so (buf + i) is at the >> start of the last line of (the interesting part of) sb. > > Did you catch th

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-22 Thread Brandon Casey
On Mon, Jan 21, 2013 at 11:54 PM, Jonathan Nieder wrote: > Hi, > > Brandon Casey wrote: > >> --- a/sequencer.c >> +++ b/sequencer.c > [...] >> @@ -1042,13 +1041,8 @@ static int ends_rfc2822_footer(struct strbuf *sb, int >> ignore_footer) > > Git is checking if (sb->buf) ends with a "Signed-off-by

Re: [PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-21 Thread Jonathan Nieder
Hi, Brandon Casey wrote: > --- a/sequencer.c > +++ b/sequencer.c [...] > @@ -1042,13 +1041,8 @@ static int ends_rfc2822_footer(struct strbuf *sb, int > ignore_footer) Git is checking if (sb->buf) ends with a "Signed-off-by:" style line. If it doesn't, it will need to add an extra blank line be

[PATCH v2 01/10] sequencer.c: remove broken support for rfc2822 continuation in footer

2013-01-21 Thread Brandon Casey
Commit c1e01b0c generalized the detection of the last paragraph signed-off-by footer and used rfc2822 as a guideline. Support for rfc2822 style continuation lines was also implemented, but not correctly, so it has never detected a line beginning with space or tab as a continuation of the previous