[Kmymoney-devel] [kmymoney] /: Add generation of version suffix for Git based repository

Thomas Baumgart thb at net-bembel.de
Fri Nov 11 13:36:00 UTC 2011


Hi,

on Friday 11 November 2011 12:55:40 Alvaro Soliverez wrote:

> Hello all,
> keep in mind that the branch name in git doesn't mean squat. The only one
> thing that can identify the proper version is the commit id. The id
> guarantees a specific parent. If rebased, the commit id will change.
> However, you can have n number of branches, named the way you want, and
> they could have stuff that doesn't really match the "branch name".

The variable name is a leftover of my first attempt. The current 
implementation contains the commit id (actually the first 10 chars of it).

BTW: What do I need to do to get those commit mails. Something special in the 
commitfilter?





> To give a proper example:
> - at this moment I have a repository of Telepathy in my local PC. The
> repository has 3 branches: master, upstream, android
> Upstream contains stuff from the fd.o repository (eg. master on the public,
> well-known repository in freedesktop.org), master branch contains stuff
> from an old closed repo I have worked on stuff for a client, and android is
> a branch I'm using to merge both master and upstream branches to prepare
> patches.
> 
> Git brings in a different way of thinking, and some stuff no longer has the
> meaning we'd expect it too in other source repositories.
> 
> Regards,
> Alvaro
> 
> On Fri, Nov 11, 2011 at 8:40 AM, Thomas Baumgart <thb at net-bembel.de> wrote:
> > Git commit a7dfac98ae4f913f43e55ff318f7f00806d2a215 by Thomas Baumgart.
> > Committed on 11/11/2011 at 12:40.
> > Pushed by tbaumgart into branch 'master'.
> > 
> > Add generation of version suffix for Git based repository
> > 
> > M  +16   -0    CMakeLists.txt
> > 
> > http://commits.kde.org/kmymoney/a7dfac98ae4f913f43e55ff318f7f00806d2a215
> > 
> > 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
-------------------------------------------------------------
There are two rules for success in life:
Rule 1: Don't tell people everything you know.
-------------------------------------------------------------
-------------- 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/67a57eda/attachment.sig>


More information about the KMyMoney-devel mailing list