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

Re: --diff-cmd doesn't use -u per default

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Tue, 10 Jun 2008 10:50:25 -0400

By the way, I haven't looked closely, but I'm betting that the problem is
the difference between a NULL user_args array and an empty one getting
passed into svn_io_run_diff().

Attached are two untested patches, each of which probably fixes the problem,
but in different ways.

C. Michael Pilato wrote:
> Jens, using 1.5.x, I can confirm that the two files to diff have shifted
> to args 5 and 6 (instead of 6 and 7) of the external diff program, and
> that '-u' is no longer provided to that program.
>
> So, yeah, looks like a bug, to me.
>
> And unfortunately, I believe our diff-cmd interface is a form of API,
> and that this constitutes an API compatability violation.
>
>
> Jens Seidel wrote:
>> Hi,
>>
>> I noticed that I had to rewrite my little vimdiff wrapper for svn diff
>> again for 1.5.x. In the past -u was provided as first argument, now it
>> isn't.
>>
>> $ svn help diff
>> --diff-cmd ARG : use ARG as diff command
>> -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:
>> -u (--unified):
>> Output 3 lines of unified context.
>>
>>
>> $ svn diff --diff-cmd diff
>> Index: subversion/po/de.po
>> ===================================================================
>> 9432d9431
>> < # CHECKME: " :"?
>> 9440c9439
>> < "A)bbrechen, Weitermac)hen, E)ditieren :\n"
>> ---
>>> "A)bbrechen, Weitermac)hen, E)ditieren:\n"
>>
>> Is this output style intented? If yes, it should maybe also mentioned
>> in the svnbook.
>>
>> Jens
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
>> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>>
>
>

-- 
C. Michael Pilato <cmpilato_at_collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

* subversion/libsvn_client/diff.c
  (set_up_diff_cmd_and_options): Initialize argv to NULL.

Index: subversion/libsvn_client/diff.c
===================================================================
--- subversion/libsvn_client/diff.c (revision 31564)
+++ subversion/libsvn_client/diff.c (working copy)
@@ -1528,7 +1528,7 @@
   /* If there was a command, arrange options to pass to it. */
   if (diff_cmd_baton->diff_cmd)
     {
- const char **argv;
+ const char **argv = NULL;
       int argc = options->nelts;
       if (argc)
         {

* subversion/libsvn_subr/io.c
  (svn_io_run_diff): Don't check user_args for NULL-ness; consult the
    num_user_args instead.

Index: subversion/libsvn_subr/io.c
===================================================================
--- subversion/libsvn_subr/io.c (revision 31564)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -2243,7 +2243,7 @@
   i = 0;
   args[i++] = diff_utf8;
 
- if (user_args != NULL)
+ if (num_user_args)
     {
       int j;
       for (j = 0; j < num_user_args; ++j)

Received on 2008-06-10 16:50:45 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.