From 5a434e2dc6afdd7fa397fc6828f203816bebd72c Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 12 Aug 2021 08:42:53 +0200 Subject: [PATCH] Improve list-latest-tag.ps1 and list-latest-tags.ps1 --- Scripts/list-latest-tag.ps1 | 5 +++-- Scripts/list-latest-tags.ps1 | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Scripts/list-latest-tag.ps1 b/Scripts/list-latest-tag.ps1 index d2ffc85e..7dc82e23 100755 --- a/Scripts/list-latest-tag.ps1 +++ b/Scripts/list-latest-tag.ps1 @@ -25,8 +25,9 @@ try { # & git -C "$RepoDir" fetch --tags # if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } - $LatestTag = (git -C "$RepoDir" describe --tags --abbrev=0 --always) - "🔖$LatestTag" + $LatestTagCommitID = (git -C "$RepoDir" rev-list --tags --max-count=1) + $LatestTag = (git -C "$RepoDir" describe --tags $LatestTagCommitID) + "🔖$LatestTag ($LatestTagCommitID)" exit 0 } catch { diff --git a/Scripts/list-latest-tags.ps1 b/Scripts/list-latest-tags.ps1 index 2445879e..087716dc 100755 --- a/Scripts/list-latest-tags.ps1 +++ b/Scripts/list-latest-tags.ps1 @@ -31,8 +31,9 @@ try { # & git -C "$Folder" fetch --tags # if ($lastExitCode -ne "0") { throw "'git fetch --tags' failed" } - $LatestTag = (git -C "$Folder" describe --tags --abbrev=0 --always) - "* $FolderName $LatestTag" + $LatestTagCommitID = (git -C "$Folder" rev-list --tags --max-count=1) + $LatestTag = (git -C "$Folder" describe --tags $LatestTagCommitID) + "* $FolderName $LatestTag ($LatestTagCommitID)" } exit 0 } catch {