← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] Update version string formatting after git migration

 

I hereby attach a patch for the mising changes.

2016-09-15 3:25 GMT+02:00 Simon Wells <swel024@xxxxxxxxx>:
> Hey Wayne,
>
> just in regards to e7e165d WriteVersionHeader.cmake still references
> the removed bzr files if you want to remove that stuff as well
>
> Simon
>
> On Tue, Sep 13, 2016 at 12:52 AM, Wayne Stambaugh <stambaughw@xxxxxxxxx> wrote:
>> Probably not.  We can always resurrect it from the dead should the need
>> be.  I noticed the subversion stuff is still in there as well and we
>> haven't used svn since 2009.  I'll remove it when I get a chance.
>>
>> On 9/10/2016 4:47 PM, Simon Wells wrote:
>>> Is there any point in keeping around CreateBZRVersionHeader.cmake and
>>> FindBzr.cmake as i am not sure there is any bzr distribution methods
>>> left
>>>
>>> On Sun, Sep 11, 2016 at 12:21 AM, Nick Østergaard <oe.nick@xxxxxxxxx> wrote:
>>>> Den 09/09/2016 20.09 skrev "Wayne Stambaugh" <stambaughw@xxxxxxxxx>:
>>>>>
>>>>> Have we come to any consensus on this yet?  I'm not sure the fake bzr
>>>>> revision numbers have any meaning.  Git doesn't have any concept of
>>>>> linear commits so having a linear number will only make sense when
>>>>> building from the master repo.  These numbers will not track upstream
>>>>> for anything built from a local repo that has deviated from the main
>>>>> repo.
>>>>
>>>> This was also the case for BZR  :)
>>>>
>>>>> I'm leaning towards not using them.  The hash is always accurate.
>>>>>  If the is a commit hash that's not in the main repo, then it's obvious
>>>>> that the build is someone's custom commits.  I'm OK with this patch as
>>>>> is.  If there are no majo objects, @Chris go ahead and commit it.
>>>>>
>>>>> On 8/27/2016 2:49 PM, Mark Roszko wrote:
>>>>>> rev 1234 the same meaning as rev 67230ac, you have to look it up
>>>>>> regardless on git.
>>>>>>
>>>>>> On Sat, Aug 27, 2016 at 11:48 AM, jp charras <jp.charras@xxxxxxxxxx>
>>>>>> wrote:
>>>>>>> Le 27/08/2016 à 17:14, Chris Pavlina a écrit :
>>>>>>>> Now that we've migrated from bzr, there isn't much reason to keep
>>>>>>>> attaching a (now fake) bzr revision number to the version string.
>>>>>>>> Additionally, we can choose a sensible default branch name if one
>>>>>>>> isn't
>>>>>>>> specified on the cmake line, rather than "product". This patch
>>>>>>>> reformats
>>>>>>>> the version strings to:
>>>>>>>>
>>>>>>>> (2016-08-26 revision 67230ac)-master
>>>>>>>>  |                   |        |
>>>>>>>>  |                   |        custom branch name if set. Otherwise,
>>>>>>>>  |                   |        branch name, "HEAD" if not on a branch,
>>>>>>>>  |                   |          or "unknown" if no .git present
>>>>>>>>  |                   |
>>>>>>>>  |                   abbreviated commit hash, or no-git if no .git
>>>>>>>>  |                     present
>>>>>>>>  |
>>>>>>>>  date of commit, or date of build if no .git present
>>>>>>>
>>>>>>> I find the bzr revision number useful to easily know the order of
>>>>>>> revisions.
>>>>>>> the name bzr is now a bit strange, so the version string could be:
>>>>>>>
>>>>>>> (2016-08-26 rev 1234 git 67230ac)-master
>>>>>>>
>>>>>>> (users, many times, just give a rev number, no the full version string,
>>>>>>> so in a bug or mail, rev
>>>>>>> 1234 has meaning, but revision 67230ac has no meaning, at least for
>>>>>>> me).
>>>>>>>
>>>>>>> --
>>>>>>> Jean-Pierre CHARRAS
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~kicad-developers
>>>> Post to     : kicad-developers@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~kicad-developers
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
From a238dd21705225f72e8a400a86eaa0a1f60c0ece Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nick=20=C3=98stergaard?= <oe.nick@xxxxxxxxx>
Date: Thu, 15 Sep 2016 07:43:12 +0200
Subject: [PATCH] Remove now obsolete bzr check

---
 CMakeModules/WriteVersionHeader.cmake | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/CMakeModules/WriteVersionHeader.cmake b/CMakeModules/WriteVersionHeader.cmake
index da1b9a4..fa10f23 100644
--- a/CMakeModules/WriteVersionHeader.cmake
+++ b/CMakeModules/WriteVersionHeader.cmake
@@ -22,20 +22,16 @@
 #  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 #
 
-# Automagically create version header file if the version string was not defined during
-# the build configuration.  If CreateBzrVersionHeader or CreateGitVersionHeader cannot
-# determine the current repo version, a version.h file is still created with
-# KICAD_BUILD_VERSION set to "no-vcs-found".
+# Automagically create version header file if the version string was
+# not defined during the build configuration.  If
+# CreateGitVersionHeader cannot determine the current repo version, a
+# version.h file is still created with KICAD_BUILD_VERSION set to
+# "no-vcs-found".
 if( NOT KICAD_BUILD_VERSION )
     set( _wvh_version_str "no-vcs-found" )
 
-    # Detect the appropiate VCS and set the version string.
-    if( EXISTS "${SRC_PATH}/.bzr" )
-        message( STATUS "Using Bazaar to determine build version string." )
-        include( ${CMAKE_MODULE_PATH}/CreateBzrVersionHeader.cmake )
-        create_bzr_version_header( ${SRC_PATH} )
-        set( _wvh_version_str ${KICAD_BUILD_VERSION} )
-    elseif( EXISTS "${SRC_PATH}/.git" )
+    # Attempt to detect if we have a git repo and set the version string.
+    if( EXISTS "${SRC_PATH}/.git" )
         message( STATUS "Using Git to determine build version string." )
         include( ${CMAKE_MODULE_PATH}/CreateGitVersionHeader.cmake )
         create_git_version_header( ${SRC_PATH} )
-- 
2.9.3


Follow ups

References