Hi Paul,
> The HTML output uses a side-by-side diff but the terminal output uses
> `diff -u` style output. It would be nice to have an option for
> side-by-side diffs with the terminal output. The icdiff package
> contains a Python 3 module that could be used for this.
I think this could be made to work. As a demo, I just knocked
together:
--- a/diffoscope/diff.py
+++ b/diffoscope/diff.py
@@ -324,7 +324,11 @@ def diff(feeder1, feeder2):
fifo2_path = os.path.join(tmpdir, 'fifo2')
with FIFOFeeder(feeder1, fifo1_path) as fifo1, \
FIFOFeeder(feeder2, fifo2_path) as fifo2:
- return run_diff(fifo1_path, fifo2_path, fifo1.end_nl_q,
fifo2.end_nl_q)
+ from icdiff import ConsoleDiff
+ cd = ConsoleDiff(cols=100)
+ lines_1 = open(fifo1_path).readlines()
+ lines_2 = open(fifo2_path).readlines()
+ return '\n'.join(cd.make_table(lines_1, lines_2, '', '', numlines=7))
... which resulted in the attached.
One difficulty however will be in passing in a sane value of `cols` to
ConsoleDiff; not because it's difficult to obtain (see icdiff.py for
this terminal foo) but rather we need to subtract 2 or 3 for each
indentation/recursion level and we may not know that at the time we
run icdiff.
Best wishes,
--
,''`.
: :' : Chris Lamb
`. `'` [email protected] / chris-lamb.co.uk
`-
_______________________________________________
Reproducible-builds mailing list
[email protected]
https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/reproducible-builds