Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb1c61d9

Browse files
committed
Make "git tag" sort our SemVer-ish tags correctly
This sorts numerically for each of major, minor, and patch,rather than, e.g., rating 2.1.15 as a higher version than 2.1.2.It also rates things like X-beta and X-rc as lower versions than X,but X-patched (not SemVer, but present in this project) as higherversions than X.
1 parent335d03b commitb1c61d9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

‎Makefile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ clean:
88

99
release: clean
1010
# Check if latest tag is the current head we're releasing
11-
echo"Latest tag =$$(git tag -l '[0-9]*' --sort=-v:refname | head -n1)"
12-
echo"HEAD SHA =$$(git rev-parse HEAD)"
13-
echo"Latest tag SHA =$$(git tag -l '[0-9]*' --sort=-v:refname | head -n1 | xargs git rev-parse)"
14-
@test"$$(git rev-parse HEAD)" ="$$(git tag -l '[0-9]*' --sort=-v:refname | head -n1 | xargs git rev-parse)"
11+
@config_opts="$$(printf ' -c versionsort.suffix=-%s' alpha beta pre rc RC)"&&\
12+
latest_tag=$$(git $$config_opts tag -l '[0-9]*' --sort=-v:refname | head -n1)&&\
13+
head_sha=$$(git rev-parse HEAD) latest_tag_sha=$$(git rev-parse "$$latest_tag")&&\
14+
printf'%-14s = %s\n''Latest tag'"$$latest_tag"\
15+
'HEAD SHA'"$$head_sha"\
16+
'Latest tag SHA'"$$latest_tag_sha"&&\
17+
test"$$head_sha" ="$$latest_tag_sha"
18+
1519
make force_release
1620

1721
force_release: clean

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp