From c20cfc5f7d0ffdd9fe7f65e2aaad11a4b32ea0c8 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 1 Feb 2012 13:35:33 +0100 Subject: [PATCH 1/2] + implement mechanism to extract version number from Git --- src/Tools/SubWCRev.py | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/Tools/SubWCRev.py b/src/Tools/SubWCRev.py index dc8a4bc32..28835ce36 100644 --- a/src/Tools/SubWCRev.py +++ b/src/Tools/SubWCRev.py @@ -139,8 +139,38 @@ class BazaarControl(VersionControl): print "bazaar" class GitControl(VersionControl): + #http://www.hermanradtke.com/blog/canonical-version-numbers-with-git/ + #http://blog.marcingil.com/2011/11/creating-build-numbers-using-git-commits/ + #http://gitref.org/remotes/#fetch + #http://cworth.org/hgbook-git/tour/ + #http://git.or.cz/course/svn.html + #git help log def extractInfo(self, srcdir): - return False + # revision number + info=os.popen("git rev-list HEAD").read() + if len(info) == 0: + return False + self.rev='%04d (Git)' % (info.count('\n')) + self.range='%04d' % (info.count('\n')) + # date/time + info=os.popen("git log -1 --date=iso").read() + info=info.split("\n") + for i in info: + r = re.match("^Date:\\W+(\\d+-\\d+-\\d+\\W+\\d+:\\d+:\\d+)", i) + if r != None: + self.date = r.groups()[0].replace('-','/') + self.time = self.date + break + #self.time = time.strftime("%Y/%m/%d %H:%M:%S") + self.url = "Unknown" + info=os.popen("git remote -v").read() + info=info.split("\n") + for i in info: + r = re.match("origin\\W+(\\S+)",i) + if r != None: + self.url = r.groups()[0] + break + return True def printInfo(self): print "git" From 67793c6c8d8f077e5639fb5aa200eb63030c53a2 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 2 Feb 2012 17:00:33 +0100 Subject: [PATCH 2/2] + add blacklists to exlude files from being archived by Git --- .gitattributes | 15 +++++++++++++++ src/3rdParty/.gitattributes | 6 ++++++ src/Doc/.gitattributes | 8 ++++++++ src/Gui/iisTaskPanel/.gitattributes | 4 ++++ src/Mod/.gitattributes | 1 + src/Mod/Mesh/.gitattributes | 2 ++ src/Tools/.gitattributes | 18 ++++++++++++++++++ 7 files changed, 54 insertions(+) create mode 100644 .gitattributes create mode 100644 src/3rdParty/.gitattributes create mode 100644 src/Doc/.gitattributes create mode 100644 src/Gui/iisTaskPanel/.gitattributes create mode 100644 src/Mod/.gitattributes create mode 100644 src/Mod/Mesh/.gitattributes create mode 100644 src/Tools/.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..ec9af644e --- /dev/null +++ b/.gitattributes @@ -0,0 +1,15 @@ +#git archive --worktree-attributes --prefix=freecad-0.13/ --output=freecad.tar.gz HEAD +acinclude.m4 export-ignore +autogen.sh export-ignore +build.sh export-ignore +BuildAll.bat export-ignore +BuildRelease.ini export-ignore +BuildRelease.py export-ignore +configure.ac export-ignore +Makefile.am export-ignore +mkinstalldirs export-ignore +package export-ignore +fc.sh export-ignore +UpdateResources.bat export-ignore +*.sln export-ignore +WindowsInstaller export-ignore diff --git a/src/3rdParty/.gitattributes b/src/3rdParty/.gitattributes new file mode 100644 index 000000000..731e814fe --- /dev/null +++ b/src/3rdParty/.gitattributes @@ -0,0 +1,6 @@ +ANN export-ignore +atlas export-ignore +CxImage export-ignore +CoinBinding.sln export-ignore +boost.CMakeLists.txt export-ignore +zlib.CMakeLists.txt export-ignore diff --git a/src/Doc/.gitattributes b/src/Doc/.gitattributes new file mode 100644 index 000000000..7a16aa129 --- /dev/null +++ b/src/Doc/.gitattributes @@ -0,0 +1,8 @@ +sphinx export-ignore +BuildDocDoxy.cfg.in export-ignore +BuildDocDoxyFull.cfg export-ignore +BuildSourceDoc.bat export-ignore +TiddlySaver.jar export-ignore +Document.mm export-ignore +FreeCAD.uml export-ignore +PythonClassModel.uml export-ignore diff --git a/src/Gui/iisTaskPanel/.gitattributes b/src/Gui/iisTaskPanel/.gitattributes new file mode 100644 index 000000000..56226ea50 --- /dev/null +++ b/src/Gui/iisTaskPanel/.gitattributes @@ -0,0 +1,4 @@ +tests export-ignore +src.pro export-ignore +config.pri export-ignore +taskpanel.pro export-ignore diff --git a/src/Mod/.gitattributes b/src/Mod/.gitattributes new file mode 100644 index 000000000..c04a39b72 --- /dev/null +++ b/src/Mod/.gitattributes @@ -0,0 +1 @@ +JtReader export-ignore diff --git a/src/Mod/Mesh/.gitattributes b/src/Mod/Mesh/.gitattributes new file mode 100644 index 000000000..b53efa0b7 --- /dev/null +++ b/src/Mod/Mesh/.gitattributes @@ -0,0 +1,2 @@ +GTSAlgos.cpp export-ignore +GTSAlgos.h export-ignore diff --git a/src/Tools/.gitattributes b/src/Tools/.gitattributes new file mode 100644 index 000000000..a5979911b --- /dev/null +++ b/src/Tools/.gitattributes @@ -0,0 +1,18 @@ +embedded export-ignore +encode export-ignore +ImageTools export-ignore +offlinedoc export-ignore +RegExp export-ignore +thumbs export-ignore +FreeCAD_widgets.sln export-ignore +wizard.cpp export-ignore +wizard.h export-ignore +BuildDoc.py export-ignore +BuildDocDoxy.cfg export-ignore +astylerc export-ignore +chm.css export-ignore +examplePy2wiki.py export-ignore +updateTranslations.py export-ignore +updatets.py export-ignore +wiki2chm.py export-ignore +WixFileTool.py export-ignore