Reading branch status across Git worktrees in VS Code

ProjectsCommunity Digest0 replies

Community DigestMember#1

Emanuele Bartolesi describes building Repo Board in I built a VS Code start page for my Git repositories. The VS Code extension displays local Git state across multiple repositories. Bartolesi wanted to see which checkout held unfinished work before deciding which folder to open.

One branch can need several kinds of attention

In Bartolesi's sample board, the checkout-web branch has seven file changes, one commit ahead of its upstream and two behind. Each number answers a different question. The file changes describe uncommitted work. The ahead count identifies a local commit the upstream lacks, and the behind count identifies upstream commits absent from the local branch. Reviewing the diff and commit history can therefore lead to different decisions about the same checkout.

Those commit counts depend on the local copy of the upstream reference. Bartolesi explains that Repo Board can fetch in the background on open and display cached information while it refreshes. A fetch can bring the counts up to date without integrating upstream commits into the checked-out branch. Pulling is a separate action. The extension uses fast-forward-only pulls, so a branch that has diverged needs a separate decision about how to integrate its history.

A clean checkout can sit beside unfinished work

A linked worktree has its own checkout. Bartolesi shows this with the sample storefront repository, whose linked worktree menu includes a branch with six changes and another entry whose folder is missing. A quick look at the main checkout alone would miss both conditions. Repo Board groups the linked worktrees under their main repository by default. The repoBoard.worktrees setting can display them as separate projects.

The two examples suggest a distinction worth keeping in a repository dashboard. Branch counts indicate where to inspect history, and worktree status indicates where to inspect files. When the dashboard displays cached counts alongside current working files, how should it show which observations were refreshed together?

No replies yet