Extract version number from git source

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
cblt2l
Posts: 155
Joined: Sat May 15, 2010 3:59 am

Extract version number from git source

Postby cblt2l » Tue Oct 02, 2012 4:08 am

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
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extract version number from git source

Postby NormandC » Tue Oct 02, 2012 4:38 am

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

Re: Extract version number from git source

Postby wmayer » Tue Oct 02, 2012 9:55 am

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

Postby cblt2l » Tue Oct 02, 2012 5:48 pm

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

Postby basaks » Mon Dec 03, 2012 7:22 am

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
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Extract version number from git source

Postby shoogen » Mon Dec 03, 2012 10:08 am

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
Posts: 9566
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Extract version number from git source

Postby jmaustpc » Mon Dec 03, 2012 10:31 am

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

Postby basaks » Mon Dec 03, 2012 10:01 pm

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
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Extract version number from git source

Postby NormandC » Tue Dec 04, 2012 12:03 am

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

Postby basaks » Tue Dec 04, 2012 12:48 am

Still not working for me. Same error code.