Leo version in log

90 views
Skip to first unread message

Rob

unread,
Aug 3, 2019, 1:19:44 PM8/3/19
to leo-editor
On my Win10 machine, I get this in the log window:

Leo 6.1-devel, devel branch
Python 3.7.3, PyQt version 5.9.6
Windows 10 AMD64 (build 10.0.17763) SP0


On my Mac, I get this:

Leo 6.1-devel, devel branch, build 3427d65881
2019-08-02 14:48:24 -0500
Python 3.7.4, PyQt version 5.13.0
darwin

Both machines use the most current version on the GitHub (devel branch).

Why does my Mac Leo log window display the Leo build number and date and the Win10 log not? I can't imagine it's the minor version differences between Python 3x or PyQt 5.x.

Also curious what shows up for Linux users or on other systems.

Rob...

Chris George

unread,
Aug 3, 2019, 3:42:49 PM8/3/19
to leo-e...@googlegroups.com

Leo 6.1-devel, devel branch, build 3427d65881

Leo 6.1-devel, devel branch, build 3427d65881


Neon Linux based on Ubuntu 18.04


Chris


--
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 leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/d3cd9ca6-99a5-4a22-8a2a-93db2fda35a7%40googlegroups.com.

Edward K. Ream

unread,
Aug 3, 2019, 4:02:43 PM8/3/19
to leo-editor
On Saturday, August 3, 2019 at 12:19:44 PM UTC-5, Rob wrote:

> Why does my Mac Leo log window display the Leo build number and date and the Win10 log not?

I get:

Leo 6.1-devel, devel branch, build 3427d65881
2019-08-02 14:48:24 -0500
Python 3.6.3, PyQt version 5.8.0
Windows 10 AMD64 (build 10.0.17134) SP0

> I can't imagine it's the minor version differences between Python 3x or PyQt 5.x.

​It's not.  Look at app.computeSignon & printSignon.  It contains:

branch, junk_commit = g.gitInfo()
author
, commit, date = g.getGitVersion()
# Compute g.app.signon.
signon
= ['Leo %s' % leoVer]
if branch:
    signon
.append(', %s branch' % branch)
if commit:
    signon
.append(', build '+ commit)
if date:
    signon
.append('\n' + date)
app
.signon = ''.join(signon)

So g.getGitVersion is returning "" for the commit (build).  It's likely an issue with the cwd.  That is g.getGitVersion runs:

git log -n 1 --date=iso

HTH.

Edward

Rob

unread,
Aug 3, 2019, 4:12:33 PM8/3/19
to leo-editor
Sorry, but I don't know what 'cwd' means or how to fix it. Is that in a Leo or GitHub setting somewhere? BTW, I use GitHub desktop on both Mac and PC to update Leo (don't use command line).

So, why would they be different on two machines when I'm pulling from the same source?

Rob...

Edward K. Ream

unread,
Aug 3, 2019, 4:17:49 PM8/3/19
to leo-editor
On Sat, Aug 3, 2019 at 3:12 PM Rob <lar...@gmail.com> wrote:

Sorry, but I don't know what 'cwd' means

cwd is the current working directory.  It can be affected by how you launch Leo. Your startup script should "cd" (change directory) to the leo-editor directory, which contains the (hidden by default) .git directory.

For example, I launch Leo with from a .bat file containing:

python c:\leo.repo\leo-editor\launchLeo.py --gui=qttabs %*

which sets the cwd as desired.

Edward

Rob

unread,
Aug 3, 2019, 4:33:44 PM8/3/19
to leo-editor
That helps to understand. However, I *am* launching from the main directory which contains the .git folder.

I open an Anaconda Powershell prompt in the main Leo directory and invoke python launchLeo.py. Isn't that then the cwd?

Rob...

Edward K. Ream

unread,
Aug 3, 2019, 4:39:08 PM8/3/19
to leo-editor
On Sat, Aug 3, 2019 at 3:33 PM Rob <lar...@gmail.com> wrote:
That helps to understand. However, I *am* launching from the main directory which contains the .git folder.

I open an Anaconda Powershell prompt in the main Leo directory and invoke python launchLeo.py. Isn't that then the cwd?

Apparently not. From the powershell prompt, do pwd :-)

Edward

Rob

unread,
Aug 3, 2019, 4:53:51 PM8/3/19
to leo-editor
Did that and confirmed I'm in the cwd. Wondering if it's related to how I get GitHub updates, but don't see a repo setting to change.

Rob...

Rob

unread,
Aug 3, 2019, 5:02:54 PM8/3/19
to leo-editor
Also, I should add the Leo log window's next line shows the current directory as where launchLeo.py and the .git folder reside. Is that the same thing as cwd?


Leo Log Window
Leo 6.1-devel, devel branch
Python 3.7.3, PyQt version 5.9.6
Windows 10 AMD64 (build 10.0.17763) SP0
current dir: D:/Synced/github repos/leo
load dir: D:/Synced/github repos/leo/leo/core

Edward K. Ream

unread,
Aug 3, 2019, 5:08:52 PM8/3/19
to leo-editor
On Sat, Aug 3, 2019 at 4:02 PM Rob <lar...@gmail.com> wrote:
Also, I should add the Leo log window's next line shows the current directory as where launchLeo.py and the .git folder reside. Is that the same thing as cwd?
current dir: D:/Synced/github repos/leo
load dir: D:/Synced/github repos/leo/leo/core
 
This is the problem.  The cwd should be the leo-editor directory, which seems to have gone missing!

My log shows:

current dir: c:/leo.repo/leo-editor
load dir: C:/leo.repo/leo-editor/leo/core

Edward

Rob

unread,
Aug 3, 2019, 6:05:38 PM8/3/19
to leo-editor
It' not missing, it's just named 'leo', not 'leo-editor'. Should that matter?

Rob...

Edward K. Ream

unread,
Aug 4, 2019, 7:05:03 AM8/4/19
to leo-editor


On Sat, Aug 3, 2019 at 5:05 PM Rob <lar...@gmail.com> wrote:
It's not missing, it's just named 'leo', not 'leo-editor'. Should that matter?

Not if it contains a .git folder.

Edward

Rob

unread,
Aug 4, 2019, 9:06:30 AM8/4/19
to leo-editor
It's a mystery! Just to verify that, I created a new clone and used the default folder name 'leo-editor'. Still not getting build number and date. Not sure what else to try.

In the big scheme, it's not that big a deal, just annoying if I want to verify I'm using the most current version.

Rob...

Leo Log Window
Leo 6.1-devel, devel branch
Python 3.7.3, PyQt version 5.9.6
Windows 10 AMD64 (build 10.0.18362) SP0
current dir: E:/GitHub Repos/leo-editor
load dir: E:/GitHub Repos/leo-editor/leo/core
global config dir: E:/GitHub Repos/leo-editor/leo/config
home dir: C:/Users/Keeney
reading settings in E:/GitHub Repos/leo-editor/leo/config/leoSettings.leo

Edward K. Ream

unread,
Aug 4, 2019, 2:14:50 PM8/4/19
to leo-editor
On Sun, Aug 4, 2019 at 8:06 AM Rob <lar...@gmail.com> wrote:
It's a mystery! Just to verify that, I created a new clone and used the default folder name 'leo-editor'. Still not getting build number and date. Not sure what else to try.

I wonder whether spaces in the parent folder's name may be a problem.

Edward

Rob

unread,
Aug 4, 2019, 2:32:51 PM8/4/19
to leo-editor
Just tried that, no difference. Next, I'm going to dig around and see if I can determine if there's a difference between how the Mac and the PCs update from GitHub.

Leo Log Window
Leo 6.1-devel, devel branch
Python 3.7.3, PyQt version 5.9.6
Windows 10 AMD64 (build 10.0.18362) SP0
current dir: E:/github/leo-editor
load dir: E:/github/leo-editor/leo/core

Rob...

Rob

unread,
Aug 4, 2019, 2:51:17 PM8/4/19
to leo-editor
One mystery solved, another one discovered. To wit;
  1. I installed Git for windows so I could use git commands from a terminal shell.
  2. From the leo-editor folder (repo) shell, I ran: >git fetch
  3. Now I get the build number and date.
Leo Log Window
Leo 6.1-devel, devel branch, build 4454b877e5
2019-08-03 18:24:33 -0500
Python 3.7.3, PyQt version 5.9.6
Windows 10 AMD64 (build 10.0.18362) SP0
current dir: E:/github/leo-editor

The next mystery is to understand why GitHub desktop doesn't provide this info when I use the 'fetch' command.

Bottom line, it appears to be an issue with the Windows version of GitHub Desktop and not the Mac version; not a Leo issue. Perhaps others will find this useful to know.

Rob...

vitalije

unread,
Aug 4, 2019, 3:32:10 PM8/4/19
to leo-editor
Recently IIRC, there was a similar problem discussed somewhere in the github issues. When installing Git for Windows installer offers a checkbox to install it only in git-bash windows or to install it system wide and the default is git-bash only. With such installation git.exe is not on the system path and Leo can't run git to check the version and branch, so it reports hard coded version information.

To check whether this is the problem one can start cmd.exe and try to run `git.exe --version`. If git is not installed on system path, an error will be reported in which case Leo won't be able to report correct version.

Perhaps Leo should warn user if the git.exe is not found on the system path. 

Vitalije

Rob

unread,
Aug 4, 2019, 4:31:05 PM8/4/19
to leo-editor
I think that explains what's going on. Apparently, GitHub Desktop (Windows version) does not install to system-wide (not even an option as I recall, it's been a while). Git for Windows (a different program) does give the option for a system-wide install. That's what I selected and am now getting the full git commands from within Leo's startup code

Thanks for clarifying that, Vitalije!

Rob....

Matt Wilkie

unread,
Aug 4, 2019, 6:16:21 PM8/4/19
to leo-editor
I've been thinking about attemtping to refactor g.Git functions for some time, or at least organized them by type, but haven't come up with a plan for how. (I haven't been able to follow the complete path Leo takes to calculate it's version.) The g.Git functions are a mixed bag of "requires git executable in PATH", "only needs .git folder (and contents)", and "really about GitHub not Git".

The 3 functions related to determining Leo version number are:
  • g.gitInfo() uses file system - returns: branch and commit hash.
  • g.getGitVersion() requires git exe - returns commit: author, hash, date-time
  • g.gitDescribe() uses git exe - returns: git tag, distance-from-tag, and commit hash
Strictly speaking for Rob's opening scenario we don't need to use git exe.

-matt


Rob

unread,
Aug 4, 2019, 6:36:08 PM8/4/19
to leo-editor
Hmm, well perhaps we do if I need to show the git info or git build number and date. For just the hard coded Leo version, then no I don't need it.
Reply all
Reply to author
Forward
0 new messages