From 4118138cf070745cf4f7036af6fcdf8b2a2930e2 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 24 Aug 2015 10:54:31 +0800 Subject: [PATCH 1/3] update commit script --- trunk/scripts/git.commit.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/trunk/scripts/git.commit.sh b/trunk/scripts/git.commit.sh index e6f1e0d7c..863cbf98a 100755 --- a/trunk/scripts/git.commit.sh +++ b/trunk/scripts/git.commit.sh @@ -23,7 +23,8 @@ work_dir=`(cd ${work_dir}/.. && pwd)` product_dir=$work_dir # allow start script from any dir -cd $work_dir && git checkout 2.0release +cd $work_dir && work_branch=`git branch -a|grep "*"|awk '{print $2}'` && git checkout 2.0release +ret=$"; if [[ $ret -ne 0 ]]; then echo "switch branch failed. ret=$ret"; exit $ret; fi . ${product_dir}/scripts/_log.sh ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi @@ -76,4 +77,7 @@ sync_push --tags srs.oschina sync_push --tags srs.gitlab ok_msg "push tags ok" +git checkout $work_branch +ok_msg "switch to work branch $work_branch" + exit 0 From 8e259eb0c22e72d60928707aa067912933e0a247 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 24 Aug 2015 10:57:12 +0800 Subject: [PATCH 2/3] refine the commit script --- trunk/scripts/git.commit.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trunk/scripts/git.commit.sh b/trunk/scripts/git.commit.sh index 863cbf98a..0b9e92be2 100755 --- a/trunk/scripts/git.commit.sh +++ b/trunk/scripts/git.commit.sh @@ -23,8 +23,10 @@ work_dir=`(cd ${work_dir}/.. && pwd)` product_dir=$work_dir # allow start script from any dir -cd $work_dir && work_branch=`git branch -a|grep "*"|awk '{print $2}'` && git checkout 2.0release +cd $work_dir && work_branch=`git branch -a|grep "*"|awk '{print $2}'` && commit_branch=2.0release && git checkout $commit_branch ret=$"; if [[ $ret -ne 0 ]]; then echo "switch branch failed. ret=$ret"; exit $ret; fi +echo "work branch is $work_branch" +echo "commit branch is $commit_branch" . ${product_dir}/scripts/_log.sh ret=$?; if [[ $ret -ne 0 ]]; then exit $ret; fi From 064031cac16acccebff6d79ec4287e0ba50569d6 Mon Sep 17 00:00:00 2001 From: winlin Date: Mon, 24 Aug 2015 10:59:32 +0800 Subject: [PATCH 3/3] refine commit script --- trunk/scripts/git.commit.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/scripts/git.commit.sh b/trunk/scripts/git.commit.sh index 0b9e92be2..2cbc0cfd4 100755 --- a/trunk/scripts/git.commit.sh +++ b/trunk/scripts/git.commit.sh @@ -2,7 +2,7 @@ cat <>/dev/null touch git-ensure-commit && -echo "cd `pwd` && git checkout develop &&" >git-ensure-commit && +echo "cd `pwd` &&" >git-ensure-commit && echo "bash `pwd`/git.commit.sh" >>git-ensure-commit && chmod +x git-ensure-commit && sudo rm -f /bin/git-ensure-commit &&