[darcs-devel] [patch1952] Added interactive flag to diff

Ben Franksen bugs at darcs.net
Fri Jan 24 15:17:37 UTC 2020


Ben Franksen <ben.franksen at online.de> added the comment:

Yes, this is largely what I meant.

However, this won't compile on Windows because you forgot to adapt the
#else part of execInteractive'.

Regarding names:

 * I wouldn't bother with adding a new function execInteractive', just
change the type of execInteractive and adapt the only other call site
(Darcs.UI.External.runEditor), perhaps using a local function definition
there to avoid repetition of Just.

 * The cmd' in the diff command I would name cmdline, indicating that it
may consist of a command plus arguments.

The fact that we are now returning 'empty' makes it quite clear that
getDiffDoc no longer works as expected: the output of the external diff
will be seen on the console but it will not be part of the Doc returned
from getDiffDoc.

Since neither Ganesh nor Simon have commented, I feel entitled to
unilaterally decide that we can remove getDiffDoc and fold it back into
doDiff. This will also allow us to fix a second issue with your (last)
patch: we now see the output from the external diff command /before/ the
patch descriptions are printed, whereas the intention of the code
obviously is to first print the patch descriptions and then the diff (as
we do with whatsnew). So we need to move the call to rundiff down i.e.
after we output the result of 'changelog (getDiffInfo opts morepatches)'.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1952>
__________________________________


More information about the darcs-devel mailing list