How to diff one file across branches *or* revs

23 views
Skip to first unread message

Edward K. Ream

unread,
Oct 13, 2020, 9:54:46 AM10/13/20
to leo-editor
leoPy.leo contains the following script.  I have just renamed it to "script: diff-branches/revs (one file)":

import leo.commands.editFileCommands as efc

efc
.GitDiffController(c).diff_two_branches(
    branch1
='bc24e607a5', # old branch/rev
    branch2
='devel', # new branch/rev
    fn
='leo/plugins/free_layout.py',
    directory
=None,
)

Previously, I had assumed that only branch names could be used, but then I thought that git generally allows many kind of specifiers, as shown above. This is very convenient and is way, way, way easier to understand than using gitk.

Edward

Thomas Passin

unread,
Oct 13, 2020, 10:51:17 AM10/13/20
to leo-editor
In which branch have you done the renaming?

Edward K. Ream

unread,
Oct 13, 2020, 11:10:32 AM10/13/20
to leo-editor
On Tue, Oct 13, 2020 at 9:51 AM Thomas Passin <tbp1...@gmail.com> wrote:
In which branch have you done the renaming?

Actually, nowhere yet :-) The script is in my local leoPy.leo, not in LeoPyRef.leo.

Edward

Edward K. Ream

unread,
Oct 13, 2020, 12:10:35 PM10/13/20
to leo-editor
Now that the open-leo-py-ref-leo command exists, it was a snap to update LeoPyRef.leo in devel.

Edward
Reply all
Reply to author
Forward
0 new messages