[GH-ISSUE #4390] [Other] update.sh: on any clone whose remote has no main, every failed pull is misdiagnosed as old history #1953

Closed
opened 2026-11-04 01:55:33 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4390

Problem: update.sh gates its "old history" recovery on ! git merge-base HEAD origin/main (line 20). The condition was meant for "no commit in common with origin/main" — but it is equally true when origin/main DOES NOT EXIST: merge-base then exits 128. So on a source FORK whose remote has no main branch (any fork tracking its own default branch — e.g. memory-core), every ordinary git pull --ff-only failure (diverged local commit) takes the old-history path, which then tries git checkout -B <branch> origin/main (line 43) — a ref that does not exist there.

Environment:
Strata Version: 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag)
OS: Linux x86-64
Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own.

Reproduce (measured): live check — git merge-base HEAD origin/main → fatal: Not a valid object name origin/main, exit 128. Sandbox: bare origin with only branch memory-core, diverged clone → git pull --ff-only fails → the old-history branch is entered, a spurious pre-cleanup-backup branch is made and removed, and the remedy fails with exit 128 ('origin/main' is not a commit) → update.sh exits 1 with "Could not move to the new history".
Expected: distinguish "no common history" from "origin/main is absent here" (or use the real upstream ref), and name the actual remedy (merge/rebase the current branch).
Actual: an ordinary divergence on a fork reads as a corrupt clone.

Reproduction status: the condition and the failing remedy measured in a sandbox bare-origin clone; the Windows .bat twin of the same logic not checked.

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4390 Problem: update.sh gates its "old history" recovery on `! git merge-base HEAD origin/main` (line 20). The condition was meant for "no commit in common with origin/main" — but it is equally true when `origin/main` DOES NOT EXIST: merge-base then exits 128. So on a source FORK whose remote has no main branch (any fork tracking its own default branch — e.g. memory-core), every ordinary `git pull --ff-only` failure (diverged local commit) takes the old-history path, which then tries `git checkout -B <branch> origin/main` (line 43) — a ref that does not exist there. Environment: **Strata Version:** 0.2.7 (source checkout at tag v0.2.7, commit 5e8a4cca; the file discussed is byte-identical to the tag) **OS:** Linux x86-64 Reported from the Strata-Mnemosyne fork's merged tree; the offending code is upstream's own. Reproduce (measured): live check — `git merge-base HEAD origin/main` → `fatal: Not a valid object name origin/main`, exit 128. Sandbox: bare origin with only branch memory-core, diverged clone → `git pull --ff-only` fails → the old-history branch is entered, a spurious pre-cleanup-backup branch is made and removed, and the remedy fails with exit 128 (`'origin/main' is not a commit`) → update.sh exits 1 with "Could not move to the new history". Expected: distinguish "no common history" from "origin/main is absent here" (or use the real upstream ref), and name the actual remedy (merge/rebase the current branch). Actual: an ordinary divergence on a fork reads as a corrupt clone. Reproduction status: the condition and the failing remedy measured in a sandbox bare-origin clone; the Windows .bat twin of the same logic not checked.
Author
Owner

@Nyarlathoteppppp commented on GitHub (Oct 29, 2026):

I have a fix with a regression test that fails before and passes after; opening a PR shortly.

<!-- gh-comment-id:6486800546 --> @Nyarlathoteppppp commented on GitHub (Oct 29, 2026): I have a fix with a regression test that fails before and passes after; opening a PR shortly.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660395361 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1953
No description provided.