[Webkit-unassigned] [Bug 111066] svn-apply cannot apply patches which is generated by git to files that contain space characters in their path

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 4 05:06:50 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=111066





--- Comment #20 from Yuki Sekiguchi <yuki.sekiguchi at access-company.com>  2013-06-04 05:05:22 PST ---
Hi Daniel,

(In reply to comment #17)
> I spoke with Chris Jerdonek, who wrote most of the Git diff parsing machinery, about this patch. We felt that it's sufficient to start with a simple solution and iterate on it as needed. One such simple solution is to use the first path segment w of the source file path to determine where the target file path begins. Consider the following diff --git line:
> 
> diff --git WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess)2.xcscheme
> 
> Take w := "WebKit.xcworkspace/". Then locate the second occurrence of w and split the string accordingly. The source and destination file paths would then be "WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess).xcscheme", and "WebKit.xcworkspace/xcshareddata/xcschemes/All Source (target WebProcess)2.xcscheme", respectively.

OK. Clean and simple code is good :)

> We expect that this approach will handle almost all cases in practice. However, initially it won't handle cases where the top-level directory changes or certain rare cases where the first path segment may occur later in the source path (e.g. diff --git A/B A/C.txt A/D.txt; source path = "A/B A/C.txt", target path = "A/D.txt"). Moreover, if we ever want to handle non-prefix Git diffs for binary files, the approach of parsing only the first line will be necessary because such diffs only reference the source and target path in this line.
> 
> Starting with a simple solution is attractive as the implementation tends to be concise and maintains the readability and hackability of the code base. Should the simple solution turn out to be insufficient we can iterate on it towards a more comprehensive solution.

I found that moving a file through sub directories of top directory is not supported, too (e.g diff --git A/B.txt C/B.txt).
However, I think this is also rare case.

I partial reverted your suggestion in Comment #13 which support --src-prefix and --dst-prefix.
We cannot distinguish the prefix from path prefix, so I think a single character is --src-prefix or --dst-prefix.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list