[odrbin] add git-datetag
This commit is contained in:
parent
14cb5889bd
commit
3960401d57
14
.local/odrbin/git-datetag
Executable file
14
.local/odrbin/git-datetag
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/bin/sh
|
||||
branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
[ "$branch" != master ] && echo "Tagging commit on $branch branch"
|
||||
git pull > /dev/null || exit 1
|
||||
basetagname=$(date -u "+%Y.%m.%d")
|
||||
tagname=$basetagname
|
||||
i=0
|
||||
|
||||
while ! git tag -a "$tagname" -m '' 2> /dev/null; do
|
||||
i=$(( $i + 1 ))
|
||||
tagname=$basetagname-$i
|
||||
done
|
||||
|
||||
echo Tagged $tagname
|
Loading…
Reference in a new issue