Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open Beginner friendly
#4,390 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

@Nyarlathoteppppp is already working on this.

Since Oct 29, 2026.

  • #4571 by @Nyarlathoteppppp — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git, shell
Domain
tooling

Research direction

The bug is in update.sh: the old-history check at line 20 (git merge-base HEAD origin/main) also succeeds as a failure when origin/main does not exist, and the remedy at line 43 then points at that missing ref. Reproduce with a bare origin that has only a memory-core branch and a diverged clone, then run git pull --ff-only. Done means a divergence is reported as a divergence, a missing origin/main is handled separately, and the script no longer exits 1 with "Could not move to the new history" in that case.

Written by the indexing model from the issue text.

Description

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.

Dominant language
C++
Stars
11.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Niko1221/Strata

All issues in Niko1221/Strata

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.