Extract version number from git source

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Extract version number from git source

Post by cblt2l »

I'm building from git and would like to extract the revision/version number from the source. Does anyone know where I can find this? grep'ing through the source yielded nothing.

I know it has to be in there somewhere. If I go to Help -> About FreeCAD it lists the version and revision number.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extract version number from git source

Post by NormandC »

Look for the Version.h file in ./src/Build. This file is generated when running cmake.
wmayer
Founder
Posts: 20203
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Extract version number from git source

Post by wmayer »

When running cmake we execute the Python script SubWCRef.py. For a git repository the Python class GitControl generates the build number by counting the number of commits in a branch because git doesn't offer this but gives only a hash value. Major and minor version number are taken from the file Version.h.in.
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Re: Extract version number from git source

Post by cblt2l »

Thanks guys. I knew it had to be in there somewhere. :D
basaks
Posts: 4
Joined: Mon Dec 03, 2012 7:10 am

Re: Extract version number from git source

Post by basaks »

How can I download source code for this version installed on my ubuntu?
When I do
>> freecad -v

I get
"FreeCAD 0.13 Revision: 1370 (Git)"

thanks.
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extract version number from git source

Post by shoogen »

basaks wrote:How can I download source code for this version installed on my ubuntu?
"FreeCAD 0.13 Revision: 1370 (Git)"
If you want the exact Version you can clone the git repo and check the respective commit out

Code: Select all

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad
git checkout `git log origin/master --oneline --reverse --format=format:%H |head -n 1370 |tail -n 1`
Last edited by shoogen on Mon Dec 03, 2012 10:45 am, edited 1 time in total.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Extract version number from git source

Post by jmaustpc »

Do you really want the source code for an old out of date version of FreeCAD?

For the current git repo master branch code

Code: Select all

git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad
follow the instructions here

https://sourceforge.net/apps/mediawiki/ ... pileOnUnix


My version data from git master branch

OS: Ubuntu 12.04.1 LTS
Platform: 64-bit
Version: 0.13.1713 (Git)
Branch: master
Hash: 6dddb653d38f8367934243f539c3da714baf7a27
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0
basaks
Posts: 4
Joined: Mon Dec 03, 2012 7:10 am

Re: Extract version number from git source

Post by basaks »

Thanks guys. Is the git server down?
When I do
>> git clone git://free-cad.git.sourceforge.net/gitroot/free-cad/free-cad freecad

I get
free-cad.git.sourceforge.net[0: 216.34.181.91]: errno=Connection timed out
fatal: unable to connect a socket (Connection timed out)

Can someone please give it a try? However, I the server responds to ping.
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extract version number from git source

Post by NormandC »

I just did 5 minutes ago without trouble. I suggest you try again, maybe the problem was temporary.
basaks
Posts: 4
Joined: Mon Dec 03, 2012 7:10 am

Re: Extract version number from git source

Post by basaks »

Still not working for me. Same error code.
Post Reply