Skip to content

Add multi-repository tree view#139

Open
rjerue wants to merge 4 commits into
letmaik:masterfrom
rjerue:master
Open

Add multi-repository tree view#139
rjerue wants to merge 4 commits into
letmaik:masterfrom
rjerue:master

Conversation

@rjerue
Copy link
Copy Markdown

@rjerue rjerue commented May 2, 2026

Summary

I love this extension and use it more than VS Code's built-in Git view for reviewing changes. One thing I kept wanting for my workflow was the ability to see changes across multiple repositories in the same workspace without switching the active repository manually. I often have several repos with 1-2 files changed in them.

This PR adds an experimental gitTreeCompare.multiRepositoryView setting. When enabled, Git Tree Compare shows one expandable section per open Git repository. The default behavior is unchanged.

Screenshot

image

What Changed

  • Added gitTreeCompare.multiRepositoryView feature flag to settings.
  • When multiple repositories are open and the flag is enabled, the tree renders top-level repository nodes.
  • Repository-level context actions operate on the selected repository.
  • Single-repository workspaces keep the original behavior, even if the flag is enabled.
  • Per-repository state is tracked for base refs, diff results, checkbox state, and filters.
  • Auto-refresh now batches file-system changes per repository so a burst of changes across repos does not drop refreshes for earlier repos.

Why

I work in multi-root workspaces where related changes often span several repos. The current extension can compare one repository at a time, but switching back and forth makes review prep harder than it needs to be.

This keeps the existing single-repo flow intact while making the multi-repo workflow available behind a flag.

My intent is to use my own fork regardless. I am also going to have a private build that integrates with some internal tooling from my company, but I wanted to offer the agnostic parts back here in case they are useful to others and would happily make that an upstream.

I kept this scoped to the generic multi-repository behavior.

That said, treeProvider.ts is doing a lot already, and this change adds more state management to it. It may be that this should land differently, or that treeProvider should be refactored first before taking on multi-repository state. If there are gotchas in the extension architecture, UX concerns, or a preferred direction for how to structure this, I am happy to adjust.

Manual Testing

  • Verified the existing single-repository behavior still works with the setting disabled.
  • Verified a single repository still behaves like the original view when the setting is enabled.
  • Verified multiple repositories render as separate top-level sections when the setting is enabled.
  • Verified repo-level refresh only refreshes that repository.
  • Verified title-bar refresh refreshes all repositories in multi-repo mode.
  • Verified auto-refresh handles changes in multiple repositories within the debounce window.
  • Verified removed workspace repositories disappear from the tree.

Copy link
Copy Markdown
Owner

@letmaik letmaik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty cool!

I gave it a try and noticed two issues:

  • "Search changes" seems broken, the include filter is empty
  • The Refresh button seems to operate on the repo currently selected in the tree, which is a little confusing, should probably refresh all

Comment thread package.json Outdated
@rjerue
Copy link
Copy Markdown
Author

rjerue commented May 9, 2026

Will take a look at comments this weekend. Thanks for taking a look

@rjerue
Copy link
Copy Markdown
Author

rjerue commented May 11, 2026

Ok, did not use the search functionality on the prior testing. Looks to be working now.

Refresh is now also broken up into refreshAll and refresh.

Thanks for considering!

@markm-quadric
Copy link
Copy Markdown

I agree with @rjerue. I also have multiple repos in my workspace and would like to view the diffs simultaneously. This PR seems to add the exact functionality I was looking for!

thank you both for you work!

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.

3 participants