提交 c7d09f70 authored 作者: Travis Cross's avatar Travis Cross

tagscript: add better usage instructions and error checking

上级 d864e66d
...@@ -10,20 +10,34 @@ check_pwd ...@@ -10,20 +10,34 @@ check_pwd
showusage() { showusage() {
cat >&2 <<EOF cat >&2 <<EOF
usage: $0 [-s] <version> SYNOPSIS
$0 [-s] <version>
where <version> follows the format:
DESCRIPTION
1.2-alpha3 Creates a new FreeSWITCH tag after performing some sanity checks.
1.2-beta3 The tag is optionally signed if '-s' is provided, but you should
1.2-rc3 really sign any public release tags, so pass '-s'.
1.2
1.2.13-rc4 <version> follows the format:
1.2.13
etc. 1.2-alpha3
1.2-beta3
I'll take care of correctly naming the tag to be consistent with 1.2-rc3
FreeSWITCH git policy from there. 1.2
1.2.13-rc4
1.2.13
etc.
This tool will take care of correctly naming the tag to be
consistent with FreeSWITCH git policy from there.
OPTIONS
-s
Signs the resulting tag.
-d
Debug mode. Remove the tag after creating it and don't warn about
the lack of a signature.
EOF EOF
exit 1; exit 1;
...@@ -105,9 +119,31 @@ set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev" ...@@ -105,9 +119,31 @@ set_fs_ver "$gver" "$gmajor" "$gminor" "$gmicro" "$grev"
echo "Committing the new version..." >&2 echo "Committing the new version..." >&2
git add configure.in git add configure.in
git commit -m "release freeswitch-$gver" if ! (git commit --allow-empty -m "release freeswitch-$gver"); then
cat >&2 <<EOF
Committing the new version failed for some reason. Definitely look
into this before proceeding.
EOF
err "Stopping here."
fi
echo "Tagging freeswitch v$gver..." >&2 echo "Tagging freeswitch v$gver..." >&2
git tag -a ${opts} -m "freeswitch-$gver release" "v$gver" if ! (git tag -a ${opts} -m "freeswitch-$gver release" "v$gver"); then
cat >&2 <<EOF
Committing the new tag failed for some reason. Maybe you didn't
delete an old tag with this name? Definitely figure out what's wrong
before proceeding.
EOF
err "Stopping here."
fi
if $debug; then
(echo; echo "We're in debug mode, so we're cleaning up...") >&2
git tag -d "v$gver" || true
git reset --hard HEAD^ || true
fi
if [ -n "$stash_saved" ]; then if [ -n "$stash_saved" ]; then
echo "Restoring your uncommitted changes to your working directory..." >&2 echo "Restoring your uncommitted changes to your working directory..." >&2
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论