In our Version numbers (0.vv.gggg), where does the gggg come from (other than Help>AboutFreeCAD)? Is this number available via a git command? Is it stored in a .h file? Generated at build time? Is there a way to reference commit to gggg or vice versa?
Thanks,
wf
Version Number Explained?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
- wandererfan
- Veteran
- Posts: 6268
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Version Number Explained?
Deutsche FreeCAD Tutorials auf Youtube
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english
Native german speaker - so apologies for my english, no offense intended
My GrabCAD FreeCAD-Projects
FreeCAD lessons for beginners in english
Native german speaker - so apologies for my english, no offense intended
Re: Version Number Explained?
This scipt is run by Cmake https://github.com/FreeCAD/FreeCAD/blob ... ubWCRev.pywandererfan wrote:In our Version numbers (0.vv.gggg), where does the gggg come from (other than Help>AboutFreeCAD)? Is this number available via a git command? Is it stored in a .h file? Generated at build time? Is there a way to reference commit to gggg or vice versa?
It creates ..builddir/src/build/version.h
After compile it is available by python
Code: Select all
import FreeCAD
print(FreeCAD.Version()[:3])
Code: Select all
print(FreeCAD.Version()[2])
"fight the good fight"
- wandererfan
- Veteran
- Posts: 6268
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Version Number Explained?
So if I want to know the version as of a past commit, I
- check out the commit
- make a branch from the detached commit
- make a new build directory & build?
This will give me the same vv.gggg?
- check out the commit
- make a branch from the detached commit
- make a new build directory & build?
This will give me the same vv.gggg?
Re: Version Number Explained?
Only need to cmake, But this is not practical. We need to count from the hash of a commit. Should be be possible with a git command, as you originally asked. Relevant part of the script is here:https://github.com/FreeCAD/FreeCAD/blob ... ev.py#L178wandererfan wrote:- make a new build directory & build?
This will give me the same vv.gggg?
I'll try to understand the "git rev-list --count" part.
Code: Select all
git checkout `git log origin/master --oneline --reverse --format=format:%H |head -n [color=#FF0000]6707[/color] |tail -n 1`
you might need to use "upstream" or whatever you called "blessed" to use shoogen's terms.
"fight the good fight"
Re: Version Number Explained?
wandererfan wrote:In our Version numbers (0.vv.gggg), where does the gggg come from (other than Help>AboutFreeCAD)? Is this number available via a git command? Is it stored in a .h file? Generated at build time? Is there a way to reference commit to gggg or vice versa?
Thanks,
wf
Code: Select all
[przemo@localhost freecad]$ git rev-list --count HEAD
10659
- wandererfan
- Veteran
- Posts: 6268
- Joined: Tue Nov 06, 2012 5:42 pm
- Contact:
Re: Version Number Explained?
This works perfectly! Thanks.PrzemoF wrote:Code: Select all
[przemo@localhost freecad]$ git rev-list --count HEAD 10659