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.
On Tuesday, May 28, 2024 at 11:52:00 AM UTC-4 Edward K. Ream wrote:

> On Tue, May 28, 2024 at 10:33 AM Thomas Passin <[email protected]> wrote:
>
> Thanks, this looks like just the right thing.
>>
>
> You're welcome. Btw, the comment about revspecs applies to both scripts.
>
> Edward
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/189ec598-4478-412b-adb1-46f61c6b0780n%40googlegroups.com.

<<attachment: git_diff_command.zip>>

Reply via email to