fix(scripts): correctly detect an annotated tag at HEAD in changelog range
git rev-parse on an annotated tag (git tag -a, what the release process
uses) returns the tag object's hash, not the commit hash it points to
- so the HEAD == tag comparison never matched, and the script always
fell into the "not tagged yet" branch. Fixed by peeling the tag down
to its commit with ^{commit}. Verified against a real annotated tag:
now correctly shows "Changelog (<tag>)" with actual content instead
of an empty "since <tag>" section.
Also: untrack Outpost.xcodeproj/xcuserdata (already gitignored, but
was committed before that rule existed, so Xcode kept dirtying it and
blocking pulls - including the one that just happened) and ignore
scripts/package-dmg.sh's dist/ output.
This commit is contained in:
@@ -60,3 +60,6 @@ fastlane/report.xml
|
|||||||
fastlane/Preview.html
|
fastlane/Preview.html
|
||||||
fastlane/screenshots/**/*.png
|
fastlane/screenshots/**/*.png
|
||||||
fastlane/test_output
|
fastlane/test_output
|
||||||
|
|
||||||
|
# scripts/package-dmg.sh output
|
||||||
|
/dist/
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>SchemeUserState</key>
|
|
||||||
<dict>
|
|
||||||
<key>Outpost.xcscheme_^#shared#^_</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
@@ -98,7 +98,12 @@ if [ -z "$LATEST_TAG" ]; then
|
|||||||
HEADING="Changelog"
|
HEADING="Changelog"
|
||||||
else
|
else
|
||||||
HEAD_COMMIT="$(git -C "$REPO_ROOT" rev-parse HEAD)"
|
HEAD_COMMIT="$(git -C "$REPO_ROOT" rev-parse HEAD)"
|
||||||
TAG_COMMIT="$(git -C "$REPO_ROOT" rev-parse "$LATEST_TAG")"
|
# `^{commit}` peels an annotated tag down to the commit it points at —
|
||||||
|
# without it, `rev-parse` on an annotated tag (e.g. `git tag -a`) returns
|
||||||
|
# the tag *object's* hash, which never equals a commit hash, so this
|
||||||
|
# comparison would always take the "not tagged yet" branch below even
|
||||||
|
# when HEAD genuinely is the tagged commit.
|
||||||
|
TAG_COMMIT="$(git -C "$REPO_ROOT" rev-parse "${LATEST_TAG}^{commit}")"
|
||||||
if [ "$HEAD_COMMIT" = "$TAG_COMMIT" ]; then
|
if [ "$HEAD_COMMIT" = "$TAG_COMMIT" ]; then
|
||||||
PREV_TAG="$(git -C "$REPO_ROOT" describe --tags --abbrev=0 "${LATEST_TAG}^" 2>/dev/null || true)"
|
PREV_TAG="$(git -C "$REPO_ROOT" describe --tags --abbrev=0 "${LATEST_TAG}^" 2>/dev/null || true)"
|
||||||
RANGE="${PREV_TAG:+$PREV_TAG..}$LATEST_TAG"
|
RANGE="${PREV_TAG:+$PREV_TAG..}$LATEST_TAG"
|
||||||
|
|||||||
Reference in New Issue
Block a user