Skip to content

Fix/updater apply tag - #17

Merged
wvcollenburg merged 2 commits into
masterfrom
fix/updater-apply-tag
Nov 21, 2026
Merged

wvcollenburg merged 2 commits into
masterfrom
fix/updater-apply-tag

Conversation

@wvcollenburg

Copy link
Copy Markdown
Owner

Updater: apply exactly the advertised release (1.5.1)

Problem

The update check offers the newest release tag, but Apply update ran git pull of whatever branch was checked out:

  • on a branch deleted after its merge, it failed with a git error;
  • on master, it also took commits merged after the release;
  • a release tag whose VERSION disagreed with the tag (the 1.3.0 case) made installations offer the same update again after applying it.

Change

  • Apply fetches tags, then moves the checkout to the tag's commit only:
    • on master: git merge --ff-only <tag> (stays on master for the next update);
    • pinned to an earlier release (detached): git checkout --detach <tag>;
    • already at or beyond the release: nothing changes.
  • Apply refuses and changes nothing when:
    • the installation follows another branch (the message gives the git checkout master fix);
    • the installation has commits that are not part of the release;
    • the release's VERSION does not match its tag.
  • The check computes the same decision beforehand: the dialog shows the reason and disables Apply (en/nl/de/fr).
  • After an update, the dialog shows the new version immediately instead of the old one until the restart.
  • Manual (Installing and updating) describes the new behaviour and the by-hand steps.

Tests

  • tests/test_updater_apply.py: 13 tests on real git repositories (fast-forward to exactly the tag, detached install, other branch, local commits, inconsistent VERSION, already up to date, tag moved on the remote), plus a guard that git pull is gone from the apply path. They skip where git is not installed.
  • Full suite: 657 passed with git installed.
  • Live on the local stack: both refusals shown in the dialog with Apply disabled, and Apply pressed anyway left the checkout unchanged.

Note

The update to 1.5.1 is still applied by 1.5.0's updater (git pull). The new apply path takes effect from the next release onwards.

William David van Collenburg added 2 commits November 21, 2026 17:30
The check offers the newest release tag, but applying ran `git pull` of whatever branch was checked out:
on a branch deleted after its merge it failed with a git error, on master it also took commits made
after the release, and a tag whose VERSION disagreed (1.3.0) made installs offer the same update again.

- versioning.plan_apply/resolve_apply/move_to_tag: fetch tags, then decide before touching anything;
  fast-forward the default branch (or move a release-pinned detached checkout) to the tag's commit only.
  Refused, with nothing changed: another branch, commits of its own, a release whose VERSION differs
  from its tag. Already at or beyond the release: nothing to do.
- The check reports apply_blocked, so the dialog says why (en/nl/de/fr) and disables Apply before it is
  pressed; after a successful move the dialog shows the new version at once.
- Tests on real git repositories (skipped where git is missing); the manual's update steps follow.
@wvcollenburg
wvcollenburg merged commit 5793f0d into master Nov 21, 2026
2 checks passed
@wvcollenburg
wvcollenburg deleted the fix/updater-apply-tag branch November 21, 2026 20:20
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