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

Re: Review of invoke-diff-cmd-feature branch

From: Gabriela Gibson <gabriela.gibson_at_gmail.com>
Date: Tue, 21 May 2013 17:30:29 +0100

Because there is no option object that we can query from within
io.c, diff.c and other places, we have to add extra courier
parameters for every command line option we wish to add, in a
number of places.

We have 4 (potential) diff commands -- diff-cmd, diff3-cmd,
invoke-diff-cmd and invoke-diff3-cmd.

That's a lot of courier parameters, and all of them are not
neccessary to correct execution until the very end of the
process.

So, it would make sense to keep the process ignorant of what kind
of diff is required, until we need to know which one in the very
last stage.

Idea 1:

Make a command line options object we can query from anywhere
where it's needed, so we don't need any courier variables.

Idea 2:

Add a marker in front of a generic 'diff' option on the command line
which is passed as the only courier parameter that tells the inner
workings what exactly to work on.

ie: diff-cmd=diff would turn up in (say) svn_io_pick_diff_style() as
'diff-cmd-svn-optiondiff'.

In svn_io_pick_diff_style(), we check whether the marker string is

'diff-cmd-svn-optiondiff' or
'diff3-cmd-svn-optiondiff3' or
'invoke-diff-cmd-svn-optiondiffdiff %f1% ....' or,
'invoke-diff3-cmd-svn-optiondiff %f1%'...'

snip the marker bit ('...svn-option') from the payload, and use that
info to redirect the flow towards the correct diff functions, or, even
collect all the diff functions we have into one that does the entire
thing in one place.

Not pretty, but, it saves us a lot of deprecation and extra code
which only adds to the overall complexity of the code base
without actually being all that functional.
Received on 2013-05-21 18:31:05 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.