Skip to content

Fix pull overwriting local changes, npm run scripts and a few smaller bugs - #1352

Merged
bummoblizard merged 4 commits into
thebaselab:mainfrom
YONN2222:fix/upstream-issues
Oct 29, 2026
Merged

bummoblizard merged 4 commits into
thebaselab:mainfrom
YONN2222:fix/upstream-issues

Conversation

@YONN2222

Copy link
Copy Markdown
Contributor

A batch of fixes for issues I kept running into. Each commit stands on its own, so happy to split this up if you prefer smaller PRs.

Git

npm run
Scripts used to be split on spaces, so most real-world scripts failed with "command doesn't exist or is not supported" (#568, #801, #485, #889). Now:

  • &&, ||, ;, quotes and escapes
  • FOO=bar prefixes and cross-env, passed through to the node process
  • node_modules/.bin lookup walking up from the package, pre/post scripts, args after --
  • pipes, redirects, globs and $VARS go through ios_system
  • the node exit code is sent back to the app, so tsc && node dist/index.js stops when tsc fails
  • a second node command right after the first one waits for the extension to restart instead of failing to connect

Other

Testing
Built with Xcode 27 beta and tested in the iPad simulator (iOS 27):

  • npm: pre scripts, &&/||, redirects, running from a subfolder, env vars reaching node, a failing node step stopping the chain, node behind a redirect
  • git: pull with local edits (blocked, file untouched), fast-forward, diverged merge (2 parents, both sides present), remote branch checkout with upstream set, existing branch not overwritten

Added unit tests for the script parser. I couldn't get XCTest to attach to the simulator on my beta setup, so those ran outside the test host. CI should cover them.

…king branches

Pull force-checked out the merge result, so uncommitted edits were silently
discarded (thebaselab#1307). It now refuses to pull when tracked files have local
changes, like git does, and merges against the actual merge base instead of
an empty ancestor. Unrelated histories still merge without an ancestor.

Checking out a remote branch left HEAD detached (thebaselab#1240). It now creates or
reuses the matching local branch with its upstream set.

Also fixes the wrong error code reported by createBranch and a cache key
mismatch that made the diff content cache never hit.
npm run split scripts on spaces and only understood a single node binary, so
most real scripts failed with "command doesn't exist or is not supported"
(thebaselab#568, thebaselab#801, thebaselab#485, thebaselab#889). Scripts are now parsed properly:

- &&, || and ; with quoting and escapes
- FOO=bar prefixes and cross-env, passed through to the node process
- node_modules/.bin lookup walking up from the package, like npm
- pre/post scripts and extra arguments after --
- pipes, redirects, globs and $VARS fall back to ios_system
- scripts run from the package root, also when started in a subfolder

The node exit code is now reported back to the app, so a failing step stops
the chain. A node command started right after another one also waits for
the extension to come back up instead of failing to connect.
… keyboard

- Don't resume the shell continuation twice when the server has no TTY (thebaselab#1229)
- Accept plain http:// remotes, e.g. self-hosted Forgejo on a LAN (thebaselab#1294)
- Copy Relative Path is relative to the workspace, not the active editor (thebaselab#1324)
- Read-only mode no longer brings up the keyboard (thebaselab#972)
Since Xcode 16 debug builds move the app code into CodeUI.debug.dylib and
ios_system can no longer look up node, npm, npx, java and wasm (thebaselab#1159).
@bummoblizard

Copy link
Copy Markdown
Member

Impressive! Please give me some time to review everything. Thank you very much for the PR.

@bummoblizard
bummoblizard merged commit 6e71589 into thebaselab:main Oct 29, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants