Skip to content

Commit 7784359

Browse files
committed
please.sh build_mingw_w64_git: prefer newest of multiple tags pointing at HEAD
When there are multiple candidates, do prefer the newest one. That way, when we need to generate a `.windows.2` tag that points to the same commit as the corresponding `.windows.1` tag, the former is actually used (as clearly intended). Signed-off-by: Johannes Schindelin <[email protected]>
1 parent f108b17 commit 7784359

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

please.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -4814,7 +4814,7 @@ build_mingw_w64_git () { # [--only-32-bit] [--only-64-bit] [--skip-test-artifact
48144814
git clone --depth 1 --single-branch -b main https://github.com/git-for-windows/MINGW-packages /usr/src/MINGW-packages ||
48154815
die "Could not clone MINGW-packages\n"
48164816
4817-
tag="$(git for-each-ref --count=1 --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
4817+
tag="$(git for-each-ref --count=1 --sort=-taggerdate --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
48184818
test -n "$tag" || {
48194819
tag=$(git describe --match=v* "${1:-HEAD}" | sed 's/-.*//').$(date +%Y%m%d%H%M%S) &&
48204820
git tag $tag "${1:-HEAD}"

0 commit comments

Comments
 (0)