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

Re: svn diff fix for bug 2044

From: Gabriela Gibson <gabriela.gibson_at_gmail.com>
Date: Tue, 19 Mar 2013 19:56:40 +0000

On 19/03/13 13:09, Julian Foad wrote:
Julian Foad wrote:

> For the record, the summary line of issue #2044 is 'Fully customizable
> external diff invocations'. (I like to mention the summary alongside
> the number as I am not good at memorizing issue numbers.) I'm curious
> about your patch because I am interested in issue #2044 and would like
> to see how this particular change would fit in.
>
> Please could you tell me more precisely what your patch does and why?
> Of course I could read carefully through your patch to discover the
> 'what', but not the 'why'.

Hi Julian,

It's not really a patch as such, not yet anyway :> Also, this strictly
speaking is issue 2074, which was marked as a duplicate of 2044 since it
partially solves 2074.

Given the following perl script posing as my diff command:

cat << EOF > dump_diff.pl
#!/usr/bin/perl -w

print "Dumping \@ARGV...\n";
for (my $i = 0; $i < @ARGV; $i++) {
     print "Arg $i is >$ARGV[$i]<\n";
}
exit 0;
EOF

The output of this 'diff-command' looks like on a test repository with
a single change:

<quote>
g_at_musashi:~/tmp/test-wc$ $SVN diff
--diff-cmd=/home/g/programming/perlfiles/dump_diff.pl
Index: testfile
===================================================================
Dumping @ARGV...
Arg 0 is >-u<
Arg 1 is >-L<
Arg 2 is >testfile (revision 1)<
Arg 3 is >-L<
Arg 4 is >testfile (working copy)<
Arg 5 is
>/home/g/tmp/test-wc/.svn/pristine/91/91b7b0b1e27bfbf7bc646946f35fa972c47c2d32.svn-base<
Arg 6 is >/home/g/tmp/test-wc/testfile<
g_at_musashi:~/tmp/test-wc$
</quote>

The goal of my patch is to provide two facilities:
1. Allow the complete removal of the "-u" switch.
2. Allow the replacement of the "-L" switch

(One question out of 2 above is, should we allow the complete removal
of the -L as the patch does for the "-u". Currently, there is an
empty element in argv, the alternative is to add another flag, (say)
--no-diff-label)

The patch adds a 'char *user_label_string' and a 'svn_boolean_t
ext_string_present' parameter to the internal structures.

This part of the patch (once it's completed) allows you to do:

g_at_musashi:~/trunk_diff4$ ~/trunk_diff4/subversion/svn/svn diff -x ""
--diff-label="" --diff-cmd=/home/g/programming/perlfiles/dump_diff.pl
Index: subversion/include/svn_client.h
===================================================================
Dumping @ARGV...
Arg 0 is ><
Arg 1 is >subversion/include/svn_client.h (revision 1458417)<
Arg 2 is ><
Arg 3 is >subversion/include/svn_client.h (working copy)<
Arg 4 is
>/home/g/trunk_diff4/.svn/pristine/90/908abcdec38f17df77baf339075101ba4471a4e4.svn-base<
Arg 5 is >/tmp/svn-40JzGW<

or also:

g_at_musashi:~/trunk_diff4$ ~/trunk_diff4/subversion/svn/svn diff -x
"Hansel" --diff-label="Gretel" --diff-cmd=/home/g/programming/perlfiles
  /dump_diff.pl
Index: subversion/include/svn_client.h
===================================================================
Dumping @ARGV...
Arg 0 is >Hansel<
Arg 1 is >Gretel<
Arg 2 is >subversion/include/svn_client.h (revision 1458417)<
Arg 3 is >Gretel<
Arg 4 is >subversion/include/svn_client.h (working copy)<
Arg 5 is
>/home/g/trunk_diff4/.svn/pristine/90/908abcdec38f17df77baf339075101ba4471a4e4.svn-base<
Arg 6 is >/tmp/svn-BhDgjc<

otherwise, the behavior is exactly as it was before.

regards,

Gabriela
Received on 2013-03-19 20:57:03 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.