Add git version check for overlay analysis enablement#3370
Merged
henrymercer merged 22 commits intomainfrom Dec 18, 2025
Merged
Add git version check for overlay analysis enablement#3370henrymercer merged 22 commits intomainfrom
henrymercer merged 22 commits intomainfrom
Conversation
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.
Overlay analysis depends on
getFileOidsUnderPath, which usesgit ls-files --formatoption introduced in Git 2.38.0. This adds a version check to ensure overlay analysis is only enabled when the git version is new enough.Changes
src/git-utils.ts:GIT_MINIMUM_VERSION_FOR_OVERLAYconstant ("2.38.0")getGitVersionOrThrow()function that throws with detailed error messagesgetGitVersion()function with caching and error logginggitVersionAtLeast()function for semver comparisonlogGitVersionTelemetry()function to log git version as telemetry diagnosticresetCachedGitVersion()for testing supportsrc/config-utils.ts: Added git version check ingetOverlayDatabaseMode()that falls back to non-overlay analysis with a warning if git is too oldsrc/diagnostics.ts: AddedmakeTelemetryDiagnostic()helper function for creating telemetry-only diagnosticssrc/init-action.ts:logGitVersionTelemetry()for git version telemetrybundle-download-telemetryandzstd-availabilitydiagnostics to usemakeTelemetryDiagnostic()2.40.0.windows.1), caching behavior, and overlay fallback scenariosWhen git version is insufficient, users will see:
Risk assessment
Which use cases does this change impact?
Workflow types:
dynamicworkflows (Default Setup, CCR, ...).Products:
analysis-kinds: code-scanning.Environments:
github.comand/or GitHub Enterprise Cloud with Data Residency.How did/will you validate this change?
.test.tsfiles).If something goes wrong after this change is released, what are the mitigation and rollback strategies?
How will you know if something goes wrong after this change is released?
Are there any special considerations for merging or releasing this change?
Merge / deployment checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.