Repository navigation
Untangle lage git spaghetti - #1236
Merged
Elizabeth Craig (ecraig12345) merged 6 commits intoNov 5, 2026
Merged
Conversation
Elizabeth Craig (ecraig12345)
requested review from
Danny van Velzen (dannyvv) and
Nemanja Tesic (nemanjatesic)
October 16, 2026 23:32
| export async function action(options: RunCommandOptions, command: Command): Promise<void> { | ||
| if (options.watch) { | ||
| return watchAction(options, command); | ||
| const { watch } = options; |
Member
Author
There was a problem hiding this comment.
This is the same content as the previous runAction and watchAction, with deduped setup and using new helpers.
Elizabeth Craig (ecraig12345)
force-pushed
the
dedupe-git
branch
from
November 4, 2026 20:45
4e9b9c4 to
e81835b
Compare
Danny van Velzen (dannyvv)
approved these changes
Nov 4, 2026
Elizabeth Craig (ecraig12345)
merged commit Nov 5, 2026
fa3d0ab
into
microsoft:main
14 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up from #1233: Probably due to various feature additions over time, the lage CLI was doing a lot of redundant git operations on startup, which could be a major startup performance hit in huge repos where git is very slow or if there are a lot of changes.
User-facing impact
--sincefiltering and target graph creation) forrun,info, andaffected.affecteduse the same initial package-selection policy asrunandinfo, including configured ignore patterns and--tohandling (skips change detection).repoWideChangesnow include staged, unstaged, and untracked files in addition to committed branch changes (so uncommitted repo-wide changes can expand a--sincerun to all packages, matching the target hashing/caching behavior).repoWideChangesagainst paths returned by git, not against files on disk. This is more efficient and ensures deleted files match.run/infowith--scope/--to: only scan if--sinceis set and one or more staged targets is configured.Internal changes
getRepoChangeswithgetChangedFiles, collecting each branch changes and all other changes once and deduplicating paths into one snapshot.getWorkingTreeChangeshelper (used above) to get staged/unstaged/untracked files in a single git operation.ChangedFilesunion withskipped,failed, andsuccessstatuses (successalso includes file paths).getFilteredPackagesandcreateTargetGraphto accept achanges?: ChangedFilesoption and skip git detection internally.getFilteredPackagesinternally handles combining CLI/config ignores and normalizing--toas scope without dependents.createFilteredTargetGraphforrunandinfo. It checks both root pipeline and package-levellagedefinitions for staged configuration (to determine if git changes are needed), shares a git snapshot between filtering and graph construction when needed, and returns{ packages, targetGraph }.affectedcontinues to only get the filtered packages (not a full target graph). The lage service continues building a reusable graph without staged-target optimization.run's watch and regular mode intorun/action.tsto dedupe code and prevent accidental behavior differences.getPackagesByFilesto reuse preloadedPackageInfos. Clarify that its all-package fallback applies when any non-ignored file belongs to no package.