bir daha doğrudan bir şekilde Aynı bilginin alınması:
git cat-file tag <tagname>
Bu, tek bir komut kullanır ve boruyu önler. Bu zaten uzun zaman önce yanıtlandı
if git rev-parse $TAG^{tag} -- &>/dev/null
then
# Annotated tag
COMMIT=$(git rev-parse $TAG^{commit})
TAGGER=($(git cat-file tag $TAG | grep '^tagger'))
N=${#TAGGER} # Number of fields
DATE=${TAGGER[@]:$N-2:2} # Last two fields
AUTHOR=${TAGGER[@]:1:$N-3} # Everything but the first and last two
MESSAGE=$(git cat-file tag $TAG | tail -n+6)
elif git rev-parse refs/tags/$TAG -- &>/dev/null
then
# Lightweight tag - just a commit, basically
COMMIT=$(git rev-parse $TAG^{commit})
else
echo "$TAG: not a tag" >&2
fi
Çok daha hoş, teşekkürler! Güzel örnek de. – quornian