Skip to content

Show the build's git commit next to the version in Settings - #8

Merged
crazytan merged 1 commit into
mainfrom
worktree-git-sha-in-settings
Jul 26, 2026
Merged

Show the build's git commit next to the version in Settings#8
crazytan merged 1 commit into
mainfrom
worktree-git-sha-in-settings

Conversation

@crazytan

Copy link
Copy Markdown
Owner

Mirrors how KeeForge surfaces the build commit.

What changed

  • scripts/stamp_build_metadata.sh writes the short HEAD hash to an untracked BuildMetadata.xcconfig.
  • BuildConfig.xcconfig (new, committed) is the config entry point for Debug and Release; it #include?s the local Config.xcconfig and the generated BuildMetadata.xcconfig.
  • The TaskMenu scheme is now explicit in project.yml with a build pre-action that runs the stamp script, so plain Xcode/xcodebuild builds get the hash. CI and the release workflow also run the script explicitly before building/archiving.
  • Info.plist gains GITCommitHash = $(GIT_COMMIT_HASH).
  • AppState exposes currentBuildCommit and currentAppVersionDisplay; Settings renders Version 1.3.0 (a1b2c3d). Unstamped builds show Version 1.3.0 (dev). Update checks still compare currentAppVersion (marketing version) only.

Verification

  • xcodebuild build from a state with no BuildMetadata.xcconfig: the pre-action stamped it and the same build picked it up — built Contents/Info.plist has GITCommitHash = ff60523, matching git rev-parse --short HEAD.
  • Full suite: 322 tests, 0 failures (clean derived data), including new AppStateTests version-display cases and SettingsVersionRowTests, which renders the real Settings window and asserts the version row text.

Stamp BuildMetadata.xcconfig with the short HEAD hash via a scheme build
pre-action (and explicitly in CI), feed it through BuildConfig.xcconfig into
Info.plist as GITCommitHash, and render "Version 1.3.0 (a1b2c3d)" in Settings.
Builds made outside a git checkout fall back to "dev". Update checks still
compare the marketing version only.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 26, 2026

Copy link
Copy Markdown

Deploying taskmenu with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3d110de
Status:⚡️  Build in progress...

View logs

@crazytan
crazytan merged commit 3d110de into main Jul 26, 2026
2 checks passed
@crazytan
crazytan deleted the worktree-git-sha-in-settings branch July 26, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant