This command, the one to compare two revspecs, turned out not to work for me. It uses too many built-in assumptions about how it will be used and where it will be used from. For example, it has to run in an outline whose .leo file is in a repo. I don't want to develop experimental scripts like this in PyLeoRef.leo - I want to develop them somewhere else like the workbook. And I don't always want their results to get added to an outline controlled by a git repo.
So I reworked the command and its supporting methods. The command now takes an additional argument, gitdir, which specifies the top of a git repo, such as c:\Tom\git\leo-editor. If this is missing or empty, the command tries to find a git repo above the current directory. This usually works like the original command does, since the current directory is normally the same as the outline's directory. If you want, however, you can use a different one by changing the current working directory before invoking the command.
You specify the file to diff by its path relative to the git top level directory of that repo. For example leo/plugins/viewrendered3.py.
As in the original command, you have to edit the script to specify the revspecs to be compared, the gitdir, and the filename. I have commented out code to let you enter the two revspecs, but you still have to edit the file and gitdir. It shouldn't be hard to write a command using this one that takes the currently selected node of an external file, finds its git directory, inputs the revspecs from the user, and runs the diff, all as one command. I haven't done that as yet.
This command is very new and is probably not bullet-proof. But it's good enough that I have already used it for actual work. An outline containing the command is attached.