[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1197998 - in /subversion/trunk/subversion: libsvn_client/patch.c tests/cmdline/patch_tests.py

From: Konstantin Kolinko <knst.kolinko_at_gmail.com>
Date: Sun, 6 Nov 2011 19:09:25 +0400

2011/11/6 Stefan Sperling <stsp_at_elego.de>:
> On Sun, Nov 06, 2011 at 03:28:06AM +0400, Konstantin Kolinko wrote:
>> Second, regarding the test case in this commit:
>>
>> The sample patch in the test case is not fair that it does not match
>> to what "svn diff --git" or Git generates.
>
> That doesn't matter.
> The filename "/dev/null" is returned from the diff parser to
> the patch code. The patch code decides what to do with "/dev/null".
> Your suggestions don't make a difference to what's being tested.
>
>> Another test I would like to see is to use the patch format as generated by Git.
>>
>> Note that
>> - headers are a bit different
>> - additional "index..." line
>> - file modes are "100644" instead of "10644"; no revision numbers
>
> All unrelated to the "/dev/null" problem.
>
> If you want to add tests to the git-diff parser, extend the following
> file, not the high-level patch tests:
> https://svn.apache.org/repos/asf/subversion/trunk/subversion/tests/libsvn_diff/parse-diff-test.c
>

Having tests in parse-diff-test.c does not preclude you from adding
high-level tests to patch_tests.py

As an end-user I do not care about how patch parsing is done, or what
paths are returned where and what else goes on under the hood.

I do care whether I can apply particular real-live patch. I do care
whether patches generated from the official git mirrors at
http://git.apache.org/ can be contributed back to the project.

Adding more real-live test cases does improve the test suite.

I need to apply the patch using --strip option. How --strip option
interoperate with "/dev/null" path is not clear without knowing the
internals. The tests that I propose to add will cover that.

>> - paths start with "a/" and not "a/trunk"
>>
>> Thus it is to be applied with "--strip 1".
>
> This is something where git and Subversion have to differ.
> Subversion has to express paths relative to the repository root.
> Otherwise, copyfrom would be ambiguous. This is documented in the 1.7
> release notes.
>
> If you need to apply patches generated with 'svn diff --git' to a git
> tree, you may need to edit the patch to make the number of path components
> match up (e.g. change "a/branches/mybranch/..." to "a/mybranch...").
> I don't like this but so far we found no good solution to this problem.
> Ideas and patches welcome :)
>
> Another problem is that copyfrom headers in the diff output currently
> don't show the copyfrom revision.
>
> In general, 'svn diff --git' is still work in progress and not as useful
> yet as we'd like it to be. We've postponed further work on it to a future
> release.
>

Thank you. I missed that point in release notes.

Best regards,
Konstantin Kolinko
Received on 2011-11-06 16:09:58 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.