← Plugins

Source Control

Source control and a commit graph beside every workspace

$ paseo plugin add kosmoche/source-control
Report a bug
kosmocheGit24installs443b475c0a82Source
Source Control screenshot 1Source Control screenshot 2Source Control screenshot 3

Source Control adds a panel to every workspace, modelled on the one in VS Code: the workspace's repositories, the selected repository's working tree, and its commit graph. Selecting a file in it opens the file's diff in a workspace tab.

Setup: the daemon needs git on its PATH, and Paseo 0.14.0 or later. Fetch, pull and push run in the daemon with its own git credentials and cannot answer a password prompt, so a remote that asks for one needs credentials git can use without asking, such as an SSH agent or a credential helper.

The repositories are the ones VS Code would list for the workspace's folder: its own, and those one level down. Each shows its branch, marked as in VS Code when it has changed, staged or conflicting work, and, when it differs from its upstream, the commits to pull and to push. The folder's .vscode/settings.json is honoured for git.scanRepositories, git.repositoryScanMaxDepth, git.autoRepositoryDetection, git.repositoryScanIgnoredFolders, git.ignoredRepositories and git.openRepositoryInParentFolders.

In the working tree part you write a commit message, open changed files in Paseo's file tab, stage and unstage files, discard changes, and commit what is staged. Changed files are shown as a tree of folders, and a folder's buttons act on everything in it. The arrow at the right of the Commit button opens the other ways to commit, among them amending the last commit. Files in conflict are listed apart, and staging one marks it resolved, after asking, as VS Code does, while it still holds conflict markers. While the files scroll, the title of their group and the folders they are in stay at the top.

The graph draws one row per commit with its branch lanes, merges, branch names, remote branches and tags. It shows all branches, or only the checked-out branch, its upstream and the branch it was made from. As in VS Code, when the branch and its upstream have parted, an Incoming Changes row on the upstream's lane and an Outgoing Changes row above the checked-out commit, each with a dashed dot, list the files a pull would bring and a push would send. Resting the pointer on a commit shows its author, time, message, size, branches and hash on a card, as VS Code's hover does; on a phone a long press shows it. Selecting a commit lists the files it changed. Fetch, pull and push sit in the graph's title bar.

The diff is drawn as VS Code's diff editor draws it, the changed words marked within the changed lines and an overview ruler at its right marking where the file changed; a button folds the lines that did not change, as VS Code's Collapse Unchanged Regions does. An untracked file opens in Paseo's file tab instead, on the desktop and in a browser. The three parts of the panel scroll separately under title bars that stay put, and each folds from its title bar. As in VS Code, the repository list is as tall as its repositories, ten at most (on a phone, a quarter of the panel at most), and the line between the working tree and the graph drags to resize them.

Everything the panel does goes through git, run by the daemon in the workspace's repositories. To show them it runs commands that change nothing, such as status, log, show, diff and config --get: on the selected repository every three seconds and on the list of repositories every ten, so commits made by agents appear on their own. Besides git's own files it reads the folder's .vscode/settings.json and git's commit.template. As in VS Code, a repository with more than 10000 changes lists the first 10000, says so under the commit box, and is read again only after a command, a fetch or Refresh.

A repository changes only when you press a button: add, restore, rm and clean stage, unstage and discard, commit commits with the author git is configured with, and rebase --continue continues a rebase. The warning about a node_modules folder git does not ignore can add it to .gitignore. Discarded untracked files go to the Trash on macOS 15 and later; where they cannot, the panel asks before deleting them for good.

Fetch, pull and push reach the repository's own remotes and nothing else. As VS Code does with git.autofetch on, the selected repository is fetched when the panel shows it and every three minutes after, waiting while the window is in the background, so commits pushed by others appear too. Pull and push run only when pressed, as do Sync Changes, which pulls and then pushes, and Publish Branch.

Limits: the graph draws at most ten lanes side by side, and lanes further right are cut off. Diffs are plain text without syntax colours. The panel has no actions that switch or create branches.