]> git.pld-linux.org Git - projects/geninitrd.git/commitdiff
use git-for-each-ref to find last tag
authorElan Ruusamäe <glen@delfi.ee>
Wed, 29 Jun 2016 19:55:58 +0000 (22:55 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 29 Jun 2016 19:56:05 +0000 (22:56 +0300)
omits two commands from pipeline

make-tag.sh

index 6f54325318f1f26cf9d707ad4c9399298b0e971d..87aba64ac3047cf9a75c09902374d328cbb351ea 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 set -e
 rev=$(git rev-parse HEAD)
-last_tag=$(git tag -l | grep -E '^[0-9]+' | sort -V | tail -n1)
+ref=$(git for-each-ref 'refs/tags' --format='%(refname)' --sort=taggerdate | tail -n1)
+last_tag=${ref#refs/tags/}
 
 if [ -n "$1" ]; then
        tag="$1"
This page took 0.114819 seconds and 4 git commands to generate.