Daniel Shahaf (äñ§€¥£¢) created SVN-4690:
--------------------------------------------

             Summary: patch and malformed file headers (file not found)
                 Key: SVN-4690
                 URL: https://issues.apache.org/jira/browse/SVN-4690
             Project: Subversion
          Issue Type: Bug
          Components: libsvn_diff
            Reporter: Daniel Shahaf (äñ§€¥£¢)


To reproduce: apply 
https://mail-archives.apache.org/mod_mbox/subversion-dev/201604.mbox/raw/%3c20160430005350.GA23087@tarsus.local2%3e/2
 to trunk@r1803187

GNU patch 2.7.5-1+b2 (Debian stretch) applies it fine.  svn patch (current 
trunk) reports:

{{
U         subversion/svnserve/serve.c
⋮
C         subversion/libsvn_repos/repos.c     (working copy)
>         rejected hunk @@ -882,7 +882,7 @@
}}

The problem is that the hunk headers have a run of spaces instead of a tab.

Two possible improvements here:

1. Change the notification from 'rejected hunk' to 'could not find file'.  (It 
was very confusing to open the unidiff and the target file side by side and to 
see that the context lines matched 100%.)

2. Add some heuristics to try and find the file the patch is intended for, or 
prompt the user for the filename, etc.

3. (stsp also mentions that it'd have been nice not to use the 'C' notification 
here, but that ship has sailed.)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to