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

Re: svn commit: r958260 - /subversion/trunk/subversion/libsvn_client/diff.c

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Mon, 28 Jun 2010 14:38:26 +0200

On Sat, Jun 26, 2010 at 04:47:46PM -0400, Greg Stein wrote:
> On Sat, Jun 26, 2010 at 13:56, <dannas_at_apache.org> wrote:
> > Author: dannas
> > Date: Sat Jun 26 17:56:06 2010
> > New Revision: 958260
> >
> > URL: http://svn.apache.org/viewvc?rev=958260&view=rev
> > Log:
> > With SVN_EXPERIMENTAL_PATCH defined, only print the git diff header
>
> I still don't understand why we have SVN_EXPERIMENTAL_PATCH. The whole
> patch feature is in-progress. What "funny business" needs to be
> protected? There is no legacy "right way" where changes need to be
> excluded.

The original thought was that we didn't need a commandline switch since
the extra header lines would be considered noise by non-git aware patch
applications. I thought that I would use the ifdef until the diff code
had reached a stable state and then I could remove them and alter the
test output of all the diff tests.

> If you're altering the *diff* output, to enable some Git diff headers,
> then please add a (cmdline) option to do that. The default can't
> change for compat reasons, so the option will be required.

If we use the git format, then deletes, copies and moves may not contain
more than the header lines. In that case, patch applications that could
process svn diff output for 1.6 would not be able to do it for svn
<version with git diffs>.

> If this #define is protecting something else, then ... what? and why
> would PATCH be in the name?

SVN_EXPERIMENTAL_PATCH since I expected to do some changes in the svn
patch code too using ifdefs. I could have used SVN_EXPERIMENTAL_DIFF
instead. I justed wanted one define to turn on to enable the feature.

Since r958537, there is a diff extension switch to enable git diffs:

svn diff -x --git-diff [-g]

In hindsight, I'm not sure that was the best thing to do. I read this
part from svn help diff:

[[[
-x --extensions ARG : Default: '-u'. When Subversion is invoking an
                             external diff program, ARG is simply passed
                             along to the program. But when Subversion
                             is using its default internal diff
                             implementation, or when Subversion is
                             displaying blame annotations, ARG could be
                             any of the following:
]]]

I thought that --extensions would just extend the diff format and could
be usable only from within the internal diff application (we don't pass
on the information needed for creating git diffs to the external diff
tool) but the svn book says:

[[[
--extensions (-x) ARGS

    Specifies an argument or arguments that Subversion should pass to an
    external diff command when providing differences between files. If you
    wish to pass multiple arguments, you must enclose all of them in quotes
    (for example, svn diff --diff-cmd /usr/bin/diff -x "-b -E"). This switch
    can only be used if you also pass the --diff-cmd switch.
]]]

Thanks,
Daniel
Received on 2010-06-28 14:39:31 CEST

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.