|
| Option | Compares against |
|---|---|
| Current Branch Origin | The point where the current branch was created from a main development branch |
| Main Development Branch | The fork point from the first existing branch of dev, develop, main, master (remote first, then local) |
| A remote branch | The selected branch of any remote |
| Enter manually… | Any branch, tag or commit |
| Disable | Nothing — no decorations for this branch |
Hover a decorated file to see what it is compared against.
Branch Compare Decorations: Refresh Decorations recomputes everything from scratch, e.g. after a base branch was force-pushed.
⚙️ Extension Settings
| Setting | Default | Description |
|---|---|---|
branchCompareDecorations.baseRefs |
{} |
Base ref per local branch name, e.g. { "feature/login": "origin/main" }. __branch_origin__ and __main_origin__ select the special comparisons. Written by Set Base Branch. |
branchCompareDecorations.autoFetch |
true |
Fetch the remote base ref (at most every 30 seconds) before computing changes. |
Note:
branchCompareDecorations.baseRefsis stored in your user settings and keyed by branch name only, so e.g. all branches namedmainshare one base ref across repositories.
🧠 Requirements
- Git, with VS Code's built-in Git extension enabled (
git.enabled) in a trusted workspace - VS Code 1.105 or later
Branch Compare Decorations runs where your workspace is, so it also works over Remote SSH, WSL and Dev Containers.
🧩 Repository
GitHub: Florian-Noever/branch-compare-decorations
Bug reports and feature requests are welcome via Issues.
🛠️ Developer Notes
Project Architecture
| Path | Purpose |
|---|---|
src/extension.ts |
Activation: gets the Git API, registers the decoration provider and the commands |
src/utils/branchCompareProvider.ts |
FileDecorationProvider: computes the changed files per repository, fires change events |
src/utils/baselineResolver.ts |
Resolves the special base refs and the fork point HEAD is compared against |
src/utils/gitBranchPicker.ts |
Quick picks for the repository and the base ref |
src/handlers/ |
Command handlers |
src/test/ |
Mocha unit and integration tests, run inside a VS Code extension host |
Build Commands
# Type-check, lint and bundle the extension with esbuild
npm run compile
# Bundle and type-check in watch mode (default build task)
npm run watch
# Run the unit and integration tests (downloads VS Code on first run)
npm test
# Package the extension as a .vsix
npm run package
The integration tests create throwaway Git repositories in the temp folder and open them in a separate VS Code instance.
CI & Releases
CI runs on every push and pull request through the shared workflows of Florian-Noever/Florian-Noever. It runs the unit and integration tests in VS Code and packs a preview VSIX.
To release, bump the version with npm version x.y.z --no-git-tag-version and publish a GitHub release vx.y.z from a commit whose CI is green. The publish workflow builds and tests the tag, attaches the VSIX to the release and publishes it to the Visual Studio Marketplace and Open VSX.
📜 License
Licensed under the MIT License.