diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-11-21 19:19:29 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2010-11-21 19:19:29 +0300 |
commit | e635491941a2cac2e2239c2230ea3a82af4860ff (patch) | |
tree | 9d68017fb00b954887413e9fe69d0bd83232e1a5 /misc | |
parent | 5c89aea3d17fe5dabbf886626b1db6c34ee0070a (diff) | |
download | nasm-e635491941a2cac2e2239c2230ea3a82af4860ff.tar.gz nasm-e635491941a2cac2e2239c2230ea3a82af4860ff.tar.bz2 nasm-e635491941a2cac2e2239c2230ea3a82af4860ff.zip |
misc: Enhance tag-release
It remains backward compatible
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/tag-release | 48 |
1 files changed, 34 insertions, 14 deletions
diff --git a/misc/tag-release b/misc/tag-release index 230137f..c42bbd5 100755 --- a/misc/tag-release +++ b/misc/tag-release @@ -1,30 +1,50 @@ #!/bin/sh -version="$1" +version="" repo="" branch="" +push=1 + +for opt in $* +do + case "$opt" in + --ver=*) + version=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'` + ;; + --repo=*) + repo=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'` + ;; + --branch=*) + branch=`echo $opt | sed 's/[-a-zA-Z0-9]*=//'` + ;; + --no-push) + push=0 + ;; + *) + version=$opt + ;; + esac +done if [ -z "$version" ]; then - echo "Usage: $0 version [repo branch]" 1>&2 - exit 1 + echo " Usage" + echo " $0 --ver=num [--repo=name --branch=name --push]" 1>&2 + echo " Example" + echo " $0 --ver=2.10rc1 --repo=git+ssh://user@repo.or.cz/nasm.git --branch=master --no-push" 1>&2 + echo " With --no-push the changes are not pushed out to remote repo" + exit 1 fi tag="nasm-$version" -if [ $# -eq 3 ]; then - repo="$2" - branch="$3" -fi - echo "$version" > version git add version git commit -m "NASM $version" git tag -a -m "NASM $version" "$tag" -if [ $# -eq 3 ]; then - git push "$repo" "$branch" - git push "$repo" "$tag" -else - git push - git push --tags +if [ $push = 1 ]; then + echo "git push $repo $branch" + echo "git push $repo $tag" + echo "git push --tags $repo" fi + |