2011-11-30 18:45:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Creates a tag according to the number of commits on this branch
|
|
|
|
#
|
|
|
|
# To have git run this script on commit, create a "post-commit" text file in
|
|
|
|
# .git/hooks/ with the following content:
|
|
|
|
# #!/bin/sh
|
2011-12-09 22:47:44 +00:00
|
|
|
# if [ -x ./_post-commit.sh ]; then
|
2018-05-12 10:37:07 +00:00
|
|
|
# . ./_post-commit.sh
|
2011-12-09 22:47:44 +00:00
|
|
|
# fi
|
2011-11-30 18:45:16 +00:00
|
|
|
|
|
|
|
type -P git &>/dev/null || { echo "git command not found. Aborting." >&2; exit 1; }
|
|
|
|
|
2011-11-30 19:43:30 +00:00
|
|
|
TAGVER=`cat ./.tag`
|
2018-06-18 14:47:32 +00:00
|
|
|
# Only apply a tag if we're dealing with the master branch
|
|
|
|
if [ "`git rev-parse --abbrev-ref HEAD`" == "master" ]; then
|
|
|
|
git tag "b$TAGVER"
|
|
|
|
fi
|
2011-11-30 19:43:30 +00:00
|
|
|
rm ./.tag
|