Want more timely Centmin Mod News Updates?
Become a Member

Stable Branch fix cmupdate self-recovery from upstream rebase in 132.00stable

Discussion in 'Centmin Mod Github Commits' started by eva2000, May 20, 2026.

  1. eva2000

    eva2000 Administrator Staff Member

    59,480
    12,536
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,176
    Local Time:
    1:11 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    fix cmupdate self-recovery from upstream rebase in 132.00stable

    cmupdate (and updatecm.sh cron, menu 23 submenu 2, AUTO_GITUPDATE=y
    startup) breaks with "fatal: Not possible to fast-forward, aborting."
    when 141.00beta01 / 140.00beta01 / 132.00stable is rebased on GitHub.
    All four callsites did the same fast-forward-only git stash; git pull.

    A new inc/git_sync.inc helper detects divergence via
    git merge-base --is-ancestor and routes:
    - fast-forward: stash with refs/stash sentinel, pull --ff-only, pop
    only the stash it created (never user's pre-existing stash)
    - local-ahead: warn and skip, never rewinds local commits
    - diverged (upstream rebase): tag HEAD as cmupdate-pre-resync-<epoch>,
    stash dirty WT, hard-reset to origin/<branch>. Refuses to reset if
    stash failed and working tree is dirty.

    After this lands, cmupdate self-recovers on every future rebase.

    A new tools/cmupdate-fix.sh one-shot script unsticks users already
    running a pre-fix cmupdate. Auto-detects local branch, translates
    common git errors to plain English, prints step status and a
    RESULT: SUCCESS|FAILED summary with rollback commands.


    curl -fsSLo /tmp/cmupdate-fix.sh \\
    https://raw.githubusercontent.com/centminmod/centminmod/132.00stable/tools/cmupdate-fix.sh \\
    && bash /tmp/cmupdate-fix.sh

    EL7 git 1.8.3.1 compatible (git stash save -u; git merge-base
    --is-ancestor since git 1.8.0).

    Changes:
    - Add inc/git_sync.inc _cmm_git_sync_impl helper
    - Add tools/cmupdate-fix.sh recovery script
    - tools/cmupdate.sh: wrapper + panic-stub bootstrap; use helper at 86-89
    - updatecm.sh: wrapper + panic-stub; detached-HEAD-safe branch detect;
    emit grep-able cmupdate-status: branch=X rc=Y for cron mail
    - inc/updater_submenu.inc: source git_sync.inc in re_sourcefiles;
    use helper at 227-229
    - inc/cpcheck.inc: auto_gitupdate prefers helper; legacy fallback
    uses pull --ff-only so rebase failures become silent no-ops

    Continue reading...

    132.00stable branch