Re: diff --check is stupid about blank lines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> ... The problem seems to be the conditional at
> diff.c:1622:
>
>         if ((data.ws_rule & WS_TRAILING_SPACE) &&
>             data.trailing_blanks_start) {
>                 fprintf(o->file, "%s:%d: ends with blank lines.\n",
>                         data.filename, data.trailing_blanks_start);
>                 data.status = 1; /* report errors */
>         }
>
> that should probably be "if we care about trailing space, and the last
> thing we saw was a trailing blank, _and_ the last hunk adds to
> end-of-file, then...".

Instead, data.trailing_blanks_start is supposed to be reset to 0 every
time we see non-blank newline, a copied context line, or new hunk.

So if this triggers with -U0 I'd understand, but otherwise I do not see
how.



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux