Skip to content

Commit

Permalink
please.sh build_mingw_w64_git: prefer newest of multiple tags pointin…
Browse files Browse the repository at this point in the history
…g 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 <johannes.schindelin@gmx.de>
  • Loading branch information
dscho committed Aug 13, 2021
1 parent f108b17 commit 7784359
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion please.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4814,7 +4814,7 @@ build_mingw_w64_git () { # [--only-32-bit] [--only-64-bit] [--skip-test-artifact
git clone --depth 1 --single-branch -b main https://github.com/git-for-windows/MINGW-packages /usr/src/MINGW-packages ||
die "Could not clone MINGW-packages\n"
tag="$(git for-each-ref --count=1 --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
tag="$(git for-each-ref --count=1 --sort=-taggerdate --format '%(refname:short)' --points-at="${1:-HEAD}" 'refs/tags/v[0-9]*')"
test -n "$tag" || {
tag=$(git describe --match=v* "${1:-HEAD}" | sed 's/-.*//').$(date +%Y%m%d%H%M%S) &&
git tag $tag "${1:-HEAD}"
Expand Down

0 comments on commit 7784359

Please sign in to comment.