From 3e7d8097ada647b250671a3b54d68cdeed72e921 Mon Sep 17 00:00:00 2001 From: psavarmattas Date: Fri, 14 Aug 2026 03:44:47 +0100 Subject: [PATCH] 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 ()" with actual content instead of an empty "since " 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. --- .gitignore | 3 +++ .../xcschemes/xcschememanagement.plist | 14 -------------- scripts/package-dmg.sh | 7 ++++++- 3 files changed, 9 insertions(+), 15 deletions(-) delete mode 100644 Outpost.xcodeproj/xcuserdata/psmattas.xcuserdatad/xcschemes/xcschememanagement.plist diff --git a/.gitignore b/.gitignore index 52fe2f7..1f4b30c 100644 --- a/.gitignore +++ b/.gitignore @@ -60,3 +60,6 @@ fastlane/report.xml fastlane/Preview.html fastlane/screenshots/**/*.png fastlane/test_output + +# scripts/package-dmg.sh output +/dist/ diff --git a/Outpost.xcodeproj/xcuserdata/psmattas.xcuserdatad/xcschemes/xcschememanagement.plist b/Outpost.xcodeproj/xcuserdata/psmattas.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index e060b9d..0000000 --- a/Outpost.xcodeproj/xcuserdata/psmattas.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - Outpost.xcscheme_^#shared#^_ - - orderHint - 1 - - - - diff --git a/scripts/package-dmg.sh b/scripts/package-dmg.sh index babd9eb..223502c 100755 --- a/scripts/package-dmg.sh +++ b/scripts/package-dmg.sh @@ -98,7 +98,12 @@ if [ -z "$LATEST_TAG" ]; then HEADING="Changelog" else 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 PREV_TAG="$(git -C "$REPO_ROOT" describe --tags --abbrev=0 "${LATEST_TAG}^" 2>/dev/null || true)" RANGE="${PREV_TAG:+$PREV_TAG..}$LATEST_TAG"