Skip to content

Fix the bugs the new tests found: push, rebase, merge editor, Windows paths, and more - #66

Merged
antonarnaudov merged 12 commits into
mainfrom
fix/bugs-from-coverage
Sep 30, 2026
Merged

antonarnaudov merged 12 commits into
mainfrom
fix/bugs-from-coverage

Conversation

@antonarnaudov

Copy link
Copy Markdown
Contributor

Stacked on #65. Every bug here has a test that fails on the old code and passes now; the tests were written first, by the coverage push.

Git layer (both apps):

  • Push re-created a branch someone deleted on the remote, when its tracking config was left behind. Push and push-by-name now refuse and say the upstream is gone. A single-branch clone, where @{u} never resolves, still pushes.
  • A reword's #-lines were deleted after the rebase paused. The comment character stayed in .git while the queue moved into rebase-merge/.
  • A rebase that git refused up front (autostash over unresolved conflicts) was reported as stopped on conflicts.
  • Stash & Retry was offered for a rebase onto, or a pick or revert of, a name git can't resolve.
  • An unreadable repository read as a detached HEAD.

Merge editor's file writer (engine, so Merge Studio too):

  • A conflict inserted between two lines was written after the next line when only that line had been edited.
  • An add/add conflict carried an extra blank line inside each side, and lost the file's final line break. Untouched, it is now byte-for-byte what git writes.
  • Checked by fuzzing the old and new writer over 450k random merges.

Apps:

  • Extension, Windows: File History, Line History, Open Changes and the Timeline never found the file's repository, because they compared paths with /.
  • Extension: Sync's "upstream no longer exists" question now names the upstream.
  • Desktop: a repository with no commits yet shows "No commits yet", not "Couldn't load history".
  • Desktop: a failed clone shows git's reason, not a fragment of its last line.
  • Desktop, Windows: repositories are grouped inside the folders they sit in.
  • Crash reports: scrubbing a path with a space is now stable, so one crash gets one fingerprint.

Left for a decision:

  • The Changes view's push review still offers to publish a branch whose remote copy was deleted, as an explicit publish. Should it refuse like Push does?
  • After git checkout --orphan, the desktop graph still errors. The fix is in the shared LogProvider and needs the extension's "Uncommitted changes" row looked at.

🤖 Generated with Claude Code

antonarnaudov and others added 4 commits September 29, 2026 15:12
- Git: disposing a git that failed to spawn signalled pid 0, the whole
  process group, which is the extension host (it killed the test runner).
  Every kill now needs a real pid.
- Desktop: a chat cancelled just before its message went out wrote to the
  stdin it had just ended, an uncaught 'error' in the main process.
- Desktop: the AI settings started as a shallow copy of a shared constant,
  so the first connection added before any settings file existed was
  pushed into @gitstudio/ai's EMPTY_AI_SETTINGS.
- AI: an Azure base URL ending in "/" before its ?api-version query
  produced ".../gpt//chat/completions".
- Refs: annotated tags (most releases) came back with no date, because
  %(committerdate) is empty for a tag object; %(creatordate) is the
  commit's date for a commit and the tagger's for a tag.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…renderer

Tests written against real temp repositories, a local bare remote and fakes
for GitHub, the AI providers and the CLI — never the network. Every test
asserts behaviour: the git state left behind, what a page is sent, what the
person is asked and told. Bugs they found and that are not fixed yet are
marked test.todo / skip with the correct behaviour written down.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A single c8 run over the whole repo merges V8's raw coverage by script URL
and assumes every process ran the same code. A package's source is
transpiled once for its own tests and differently again when an app's tests
load it through the workspace link, so shared files were read against the
wrong text: host-bridge's scrubber reported 13% with every line tested.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ct" too

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…n Windows

Killing git.exe left the ssh it had started running and holding the clone's
pipes, so the clone never reported that it ended — the test for it hung a
Windows CI runner for four hours. taskkill /T takes the tree. The test is
capped at 30s, and the desktop, extension and git-service suites now fail a
test after five minutes instead of waiting forever.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
antonarnaudov and others added 5 commits September 30, 2026 00:01
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Push re-created a branch deleted on the remote: with its tracking config
  left behind and the remote-tracking ref pruned, a bare `git push` published
  it again. Push (and push-by-name, its twin) now refuses and says the branch
  it tracks is gone — while a single-branch clone, where @{u} never resolves,
  still pushes.
- A reword's "#" lines were deleted after the rebase paused: the chosen
  comment character stayed in .git while the queue moved into rebase-merge/.
- A rebase git refused up front (autostash over unresolved conflicts) was
  reported as a rebase stopped on conflicts. It is now refused before
  anything runs, with the reason.
- Stash & Retry was offered for a rebase onto, or a pick/revert of, a name
  git cannot resolve — git refuses the name before it looks at the tree.
- An unreadable repository (a .git file pointing nowhere) read as a detached
  HEAD, so the push review said "HEAD is detached". It now says git's error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- A conflict both sides inserted between two lines was written after the
  next line when only that next line had been edited (a, c2, <markers>
  instead of a, <markers>, c2).
- An add/add conflict (no common base) wrote each side with an extra blank
  line inside the markers, and lost the file's last line break; resolving by
  hand left a stray blank line. Untouched, the file is now byte-for-byte
  what git writes.

Checked by fuzzing the old and new writer over 450k random merges: every
other difference was the first bug being fixed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Extension: File History, Line History, Open Changes and the Timeline
  compared paths with "/" — on Windows no file was ever inside its
  repository. They use the shared separator- and case-aware check now.
- Extension: Sync's "upstream no longer exists" question named no upstream;
  it reads the configured one now ("tracks origin/topic").
- Desktop: a repository with no commits yet showed "Couldn't load history"
  instead of its "No commits yet" tile.
- Desktop: a failed clone showed git's last line — often a fragment like
  "and the repository exists." — instead of the reason.
- Desktop: on Windows, repositories were grouped outside the folders they
  sit in (backslashes from the folder picker against "/" comparisons).
- Crash reports: a path with a space scrubbed differently the second time,
  so the same crash could fingerprint twice.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… outran

The updater flow waited 20 event-loop turns for electron-updater to load, and
the rebase panel read its banner right after a keypress. Both now wait for
what they assert, capped by wall time.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
antonarnaudov and others added 2 commits September 30, 2026 14:32
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@antonarnaudov
antonarnaudov merged commit 68c1c70 into main Sep 30, 2026
10 checks passed
AutumnPizazz added a commit to AutumnPizazz/gitstudio that referenced this pull request Sep 30, 2026
Upstream's 68c1c70 — "Fix the bugs the new tests found: push, rebase,
merge editor, Windows paths, and more (GitStudioHQ#66)" — merged over the Simplified
Chinese commit. Three files conflicted; each was resolved by taking
upstream's logic and keeping the l10n wrapper:

  · apps/extension/src/history/historyContext.ts — both import lines kept.
  · apps/extension/src/statusBar/syncStatus.ts — upstream's config-based
    upstream lookup, falling back to l10n.t("its upstream").
  · packages/git-service/src/RebaseRunner.ts — upstream's `live` guards on
    the paused-on-conflict branches, their messages still translated.

The message bundle is unchanged (2991 messages, none added or removed) and
no new untranslated prose came in, so there is nothing further to localise.

One new test, apps/extension/test/stashesView.cov.test.ts, fails: with a
stale .git/index.lock in place git 2.43 exits 1 having printed nothing at
all, so the toast reads "GitStudio: Stash failed." with no reason to show.
Upstream's own code builds that message the same way, so the test is red on
68c1c70 itself and not on this merge.
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