On Sun, Aug 14, 2022 at 8:08 PM Vincent Lefevre <vincent-...@vinc17.net> wrote: > > About this bug: > > On 2022-08-14 14:11:15 -0400, Nathan Hartman wrote: > > But applying your original patch to a clean working copy and then > > running 'svn diff' does show it -- note the - and + of </Project> and > > "\ No newline at end of file" at the end of the output: > [...] > > That looks like a bug in SVN. This machine (the one I'm using now) has > > 1.13.0 so I'll try this with 1.14.2 later... > > I can reproduce the issue with svn 1.14.2, and this is due to > svn:eol-style being set to native.
Nice catch! Thanks for the reproduction script. The issue: When the file has the svn:eol-style property set and the last line of the file does not end with a newline, 'svn patch' adds a newline to the last line of the file, even when the diff does not call for it. I've confirmed that the same issue is reproduced for all possible svn:eol-style settings. (I did that by using the reproduction script as-is, and then also modifying it to try the other svn:eol-style settings of CRLF, LF, and CR.) I went through the issue tracker looking for similar issues. SVN-3556 and SVN-3991 are *not* similar, but I'm making a note of them here as they may be relevant. In particular, SVN-3991 seems to be somewhat a reverse of this issue, where the patch file, rather than the file being patched, lacks a last newline. For reference, this was found during the recent dev@s.a.o mail thread "[PATCH] URL update to https" -- see the part starting with "Are you sure" in 14 August 2022 message: https://lists.apache.org/thread/w0fld2p0qzg5oo6tqgw1tcvtolndvg9t I'll file an issue in the issue tracker... > printf %s "$(printf "%d\n" `seq 2 8`)" > file One thing I don't understand about the above is why does the outer printf %s strip the last newline from the inner one? Cheers, Nathan