Skip to content

Add Extensions, starting with Git Repositories - #5620

Merged
Marc-André Moreau (mamoreau-devolutions) merged 3 commits into
mainfrom
claude/unigetui-git-update-manager-1bb612
Oct 28, 2026
Merged

Marc-André Moreau (mamoreau-devolutions) merged 3 commits into
mainfrom
claude/unigetui-git-update-manager-1bb612

Conversation

@mamoreau-devolutions

@mamoreau-devolutions Marc-André Moreau (mamoreau-devolutions) commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Many of us keep main clones on main or master and run git fetch && git pull in a terminal tab per repository, all day, while AI agents work in worktrees. This adds a place in UniGetUI for that kind of work, separate from package management.

Extensions. Settings gains an Extensions section, set up like Package managers: a list of optional tools, each with an on/off switch, a status badge and its own settings page. Every extension is off by default and turns on or off without a restart. Each one is described once in AppExtensions, and the Extensions list, its settings page and settings search are built from that list.

Git Repositories, the first extension, keeps main clones current on their default branch:

  • Repositories: add a clone, a worktree (its main clone is added instead), or a folder like D:\dev to add every clone up to two levels down. Each clone shows its branch, its worktree count and its state: up to date, behind, local changes, diverged, not on the default branch, and so on.
  • Updating: check and update one clone or all of them. Updates are fast-forward only, so a clone with local changes, its own commits, or another branch checked out is never touched. Checks can run on a schedule, optionally followed by an update. A sidebar badge counts the clones that are behind.
  • Default branch: taken from origin/HEAD, then main, then master. It can be overridden per clone.
  • Worktrees panel: lists the selected clone's worktrees with tags for merged, remote branch deleted, changed files, locked and missing. A worktree can be opened or removed, optionally with its branch, and missing ones pruned. Removing one with unsaved files asks first.
  • Branches panel: shows each branch's upstream, how far it is ahead or behind, its commits not on the default branch, its last commit and the worktree it's checked out in. A branch can be deleted, or every merged branch at once. The default branch, and any branch checked out in a worktree, can't be deleted.
  • Panel layout: you can drag the panel's height, and it remembers both the height and which view was open.

Engine. UniGetUI.Extensions.GitRepositories runs the git executable with prompts disabled, a timeout, and both output pipes drained. Status uses --no-optional-locks so it doesn't fight with an editor or an agent.

Worktree loading was tuned on real clones with 18 and 38 agent worktrees. Branch details come from one git for-each-ref call, and the list appears before git status has run in each worktree. That cut the time before the list appears from about 5 s to about 1.3 s.

Testing

  • 35 engine tests run against real temporary repositories, with an isolated git configuration. They cover default-branch detection, fast-forward refusals, worktree and branch listing, removal and deletion.
  • App tests cover the page logic, the add button, the settings shared between the two pages, the sidebar entry turning on and off, and the extension registry. The full app suite passes (987).
  • Both dotnet format checks are clean.
  • Tested by hand in the running app on Windows, against RDM (18 worktrees), IronRDP (38 worktrees) and psign.

Not covered

  • The NativeAOT publish and the macOS/Linux builds weren't run.
  • The terminal UI has no Git Repositories page.
  • The sidebar entry, startup page option and start/stop in the main window are still wired by hand for Git Repositories. They should move onto AppExtensions when a second extension arrives.
  • ToolbarSelectionStateTests.SinglePackageActionsNeedExactlyOnePackage failed in two of the full runs (it passed in the others) with "the process cannot access the file 'catalog.json'". It's a Catalog Editor test that this PR doesn't touch.

🤖 Generated with Claude Code

First phase of the experimental Git Repositories page: a UI-free
UniGetUI.GitRepositories project that the page will build on.

- Check fetches a clone's remote once, with prune, and reports whether it
  is up to date, behind, ahead, diverged, has changed tracked files, is on
  another branch or detached, or has no remote.
- The default branch is the remote's HEAD, else main, else master.
- Update only ever fast-forwards (merge --ff-only) a clean clone that is
  on its default branch; anything else is refused and reported.
- Worktrees are listed with what makes each safe to remove: local
  changes, commits not on the remote default branch, a deleted upstream,
  locks and missing folders. Removal and prune refuse the main and locked
  worktrees, and need force for unsaved work.
- Git never prompts on a terminal, both pipes are drained, and every
  command has a time limit.

Tests run against real temporary repositories with an isolated git
configuration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Settings gains an Extensions section for optional tools that go beyond
package management. Each extension is off by default, turns on and off
without a restart, and is described once in AppExtensions, from which
the Extensions list and each extension's settings page are built.

Git Repositories is the first extension. It keeps main git clones on
their default branch up to date, with the engine added in the previous
commit:
- A sidebar page lists the clones with their state, checks and
  fast-forwards them one by one or all at once, and can check on a
  schedule and update after checking. A badge counts the clones behind.
- One Add repository button takes a clone, a worktree (its main clone is
  added) or a folder whose clones are found two levels down.
- A resizable panel under the clones shows the selected clone's
  worktrees or branches. Worktrees can be opened, removed (with their
  branch) and pruned; branches can be deleted one by one, and those
  merged into the default branch all at once.
- The worktree list shows before git status has run in each worktree,
  and branch details come from one for-each-ref call, so clones with
  dozens of agent worktrees load in about a second.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Rename UniGetUI.GitRepositories and its tests to
UniGetUI.Extensions.GitRepositories(.Tests), with matching namespaces and
an UniGetUI.Extensions solution folder, the way package managers live in
UniGetUI.PackageEngine.Managers.*. Later extensions get their own
UniGetUI.Extensions.* projects next to it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) merged commit d468451 into main Oct 28, 2026
6 checks passed
@mamoreau-devolutions
Marc-André Moreau (mamoreau-devolutions) deleted the claude/unigetui-git-update-manager-1bb612 branch October 28, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant