Re: [PATCH] apply: Allow blank *trailing* context lines to match beyond EOF

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

 



Björn Gustavsson <bgustavsson@xxxxxxxxx> writes:

> This patch should fix the problem observed by Junio, but note that
> there will be one or more blank lines left at the end of the
> file.
>
> I am not sure whether that should be fixed. In this particular
> case, the blank lines are part of the context but not part of
> the file being patched, so it could be argued that the blank
> lines should not be added back.
>
> But there are already other circumstances in which
> "--whitespace=fix" does not guarantee that the file does
> not end with blank lines, for instance if we have:
>
>  a
>  b
>  (blank line)
>  (blank line)
>  (blank line)
>  (blank line)
>  c
>  d
>
> and then delete the "c" and "d" lines:
>
>  a
>  b
>  (blank line)
>  (blank line)
>  (blank line)
>  (blank line)

Even though I think these are both worth fixing, I do not think it should
happen as part of this patch.  Because the code that needs to "fix" the
"extra blank bug" this patch introduces will need to deal with exactly the
same horizon effect as your "deleting c and d at the end will not have the
blank immediately after b in the context" example, I expect we will fix
the fallout from this patch when we fix that "delete c and d at the end"
example.
--
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]