[Kmymoney-devel] KMyMoney has moved to git

Thomas Baumgart thb at net-bembel.de
Fri Nov 11 11:46:58 UTC 2011


Hi,

on Thursday 10 November 2011 14:45:58 Alvaro Soliverez wrote:

> On Thu, Nov 10, 2011 at 10:39 AM, Thomas Baumgart <thb at net-bembel.de> wrote:
> > Hi,
> > 
> > on Thursday 10 November 2011 12:47:40 Alvaro Soliverez wrote:
> > > On Thu, Nov 10, 2011 at 6:37 AM, David Houlden <djhoulden at gmail.com>
> > 
> > wrote:
> > > > On Thursday 10 November 2011 01:49:28 Alvaro Soliverez wrote:
> > > > > Hello all,
> > > > > the move to git has been completed.
> > > > 
> > > > Hi,
> > > > 
> > > > Thanks for information and the tutorial. I have a couple of
> > > > questions. Apologies in advance if I'm jumping the gun and they are
> > > > being worked
> > 
> > on.
> > 
> > > > 1. There used to be an SVN revision number displayed in the About
> > > > KMyMoney dialog. This is now gone. Will it be replaced by a git
> > > > reference? If we report
> > > > bugs after building from git master how should we report the exact
> > > > version we
> > > > are running? Maybe the commit number from "git log -1"?
> > > 
> > > Each commit has a unique hash. That's enough to locate it even if it's
> > > present in several branches. You also have a date and time for each
> > 
> > commit,
> > 
> > > in case you need help locating it in the log.
> > 
> > I played a bit with it here locally. I currently see:
> >  4.6.90-bko-238105-4.6.0-79-g8324cfb
> > 
> > '4.6.90' as contained in CMakeLists.txt
> > 'bko-238105' as my local branch name I am currently on
> > '4.6.0-79-g8324cfb' as generated by 'git describe'
> > 
> > Does that make sense?
> 
> I don't follow. Just noting the commit id should be enough to pinpoint the
> version that is running, and even running git bisect if needed to find a
> regression.
> The commit id is unique, no matter which branch it is in.

Now available in master. The version would be something like:

  4.6.90-a7dfac98ae

where the suffix is the beginning of the commit id. This way the following is 
possible:

thb at thb-nb:~/devel/kmymoney/build> git show a7dfac98a
commit a7dfac98ae4f913f43e55ff318f7f00806d2a215
Author: Thomas Baumgart <thb at net-bembel.de>
Date:   Fri Nov 11 12:40:46 2011 +0100

    Add generation of version suffix for Git based repository

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 95da58a..3a3bd82 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,6 +40,22 @@ IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn)
   SET(ENV{LANG} ${LANG})
 ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.svn)
 
+# Determine the GIT reference (if we're based on GIT)
+IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
+  # make sure we don't use translated messages here
+  SET(LANG $ENV{LANG})
+  SET(ENV{LANG} "C")
+  EXECUTE_PROCESS(COMMAND git log -1 COMMAND head -n 1 OUTPUT_VARIABLE 
BRANCH)
+  # extract branch name
+  STRING(REGEX MATCH "commit ([^$]+)" BRANCH "${BRANCH}")
+  SET(BRANCH ${CMAKE_MATCH_1})
+  # and use the first 10 chars of the commit id
+  STRING(SUBSTRING ${BRANCH} 0 10 BRANCH)
+  SET(VERSION_SUFFIX "-${BRANCH}")
+  # switch back to the original language setting
+  SET(ENV{LANG} ${LANG})
+ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git)
+
 ######################### General Requirements ##########################
 
 # setup default CMAKE_INSTALL_PREFIX before calling FIND_PACKAGE(KDE4)

-- 

Regards

Thomas Baumgart

GPG-FP: E55E D592 F45F 116B 8429   4F99 9C59 DB40 B75D D3BA
-------------------------------------------------------------
Linux, because rebooting is for adding new hardware ...
-------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 225 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kmymoney-devel/attachments/20111111/63ee8e06/attachment.sig>


More information about the KMyMoney-devel mailing list