Does anyone have a working diff utility (file compare) that will run under Stash?
Forum Archive
Diff utility for Stash
Difflib is on of the batteries included in Python https://pymotw.com/2/difflib/
Does standard diff provided in Python module difflib (see its help file at the very end) not provide what you need?
You are quite right. Something like this does what I need:
import difflib
import sys
with open('./f1', 'r') as f1:
with open('./f2', 'r') as f2:
diff = difflib.unified_diff(
f1.readlines(),
f2.readlines(),
fromfile='f1',
tofile='f2',
)
for line in diff:
sys.stdout.write(line)
Take a look at gitui, which provides a visual differ, a side by side diff in a webview. I think this just uses difflib.HtmlDiff, which you then just load into a webview.
git for stash also comes with a three way diff tool, if you are into that sort of thing, which came from the interwebs somewhere.
@JonB Thanks. Were you referring to this: https://github.com/jsbain/gitview/blob/master/git_diff.py
yes. this is just a thin wrapper around difflib.Htmldiff. if you look in gitui.py, this shows you could then load the result into a webview and display it.
Also, in stash/lib/git/diff3.py is a three way differ, which I think can also be run as a two way differ