Module: synfig
Branch: morevna
Commit: f6235817a7a2b5a66539c494454daf2af04b2a4b
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=f6235817a7a2b5a66539c494454daf2af04b2a4b

Author: Konstantin Dmitriev <ksee.zelga...@gmail.com>
Date:   Sat Jul 18 22:51:57 2009 +0700

Detect branch better when getting git revision information
(for 'synfig --info' and about dialog).

---

 synfig-core/trunk/build_tools/autorevision.sh   |    9 ++++++++-
 synfig-studio/trunk/build_tools/autorevision.sh |    9 ++++++++-
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/synfig-core/trunk/build_tools/autorevision.sh 
b/synfig-core/trunk/build_tools/autorevision.sh
index 2ccdb01..9e31cd1 100644
--- a/synfig-core/trunk/build_tools/autorevision.sh
+++ b/synfig-core/trunk/build_tools/autorevision.sh
@@ -16,7 +16,14 @@
 get_git_id(){
        export SCM=git
        export REVISION=`cd "$1"; git log --no-color -1 | head -n 1 | cut -f 2 
-d ' '`
-       export BRANCH=`cd "$1"; git branch --no-color 2> /dev/null | sed -e 
'/^[^*]/d' -e 's/* \(.*\)/\1/'`
+       BRANCH=`cd "$1"; git branch -a --no-color --contains HEAD | sed -e 
s/\*\ // | sed -e s/\(no\ branch\)//`
+       if ( echo $BRANCH | egrep origin/master > /dev/null ); then
+               #give a priority to master branch
+               BRANCH='master'
+       else
+               BRANCH=`echo $BRANCH | cut -d ' ' -f 1`
+               BRANCH=${BRANCH#*/}
+       fi
        export DATE=`git-show --pretty=format:%ci HEAD |  head -c 10`
        DATE=${DATE:0:4}${DATE:5:2}${DATE:8:2}
        export COMPARE="$1/.git/"
diff --git a/synfig-studio/trunk/build_tools/autorevision.sh 
b/synfig-studio/trunk/build_tools/autorevision.sh
index d8ee63b..e7e7b7a 100644
--- a/synfig-studio/trunk/build_tools/autorevision.sh
+++ b/synfig-studio/trunk/build_tools/autorevision.sh
@@ -16,7 +16,14 @@
 get_git_id(){
        export SCM=git
        export REVISION_ID=`cd "$1"; git log --no-color -1 | head -n 1 | cut -f 
2 -d ' '`
-       export BRANCH=`cd "$1"; git branch --no-color 2> /dev/null | sed -e 
'/^[^*]/d' -e 's/* \(.*\)/\1/'`
+       BRANCH=`cd "$1"; git branch -a --no-color --contains HEAD | sed -e 
s/\*\ // | sed -e s/\(no\ branch\)//`
+       if ( echo $BRANCH | egrep origin/master > /dev/null ); then
+               #give a priority to master branch
+               BRANCH='master'
+       else
+               BRANCH=`echo $BRANCH | cut -d ' ' -f 1`
+               BRANCH=${BRANCH#*/}
+       fi
        export REVISION=`git-show --pretty=format:%ci HEAD |  head -c 10`
        REVISION=${REVISION:0:4}${REVISION:5:2}${REVISION:8:2}
        export COMPARE="$1/.git/"


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Synfig-devl mailing list
Synfig-devl@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to