Fix Windows tool-managed entries in repository dirty check#202
Open
DannySotzny wants to merge 5 commits intoversionize:mainfrom
Open
Fix Windows tool-managed entries in repository dirty check#202DannySotzny wants to merge 5 commits intoversionize:mainfrom
DannySotzny wants to merge 5 commits intoversionize:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates versionize’s repository dirty-state validation to avoid Windows-specific false positives caused by tool-managed (AI/agent) directories, while warning users about ignored entries.
Changes:
- Extend dirty-check logic to ignore specific Windows reparse-point (symlink/junction) entries and certain
DeletedFromWorkdirtool-directory entries that still exist on disk. - Add a
CommandLineUI.Warning()output path and new warning message templates. - Add Windows-focused validator tests covering allowed/blocked cases and silent output behavior.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| Versionize/Git/RepoStateValidator.cs | Adds Windows-only filtering/ignoring rules for tool-managed directories and warning emission for ignored entries. |
| Versionize/CommandLine/InfoMessages.cs | Introduces user-facing warning message templates for ignored tool symlinks and tool-directory entries. |
| Versionize/CommandLine/CommandLineUI.cs | Adds a new Warning() method for emitting warning-colored output based on verbosity. |
| Versionize.Tests/Git/RepoStateValidatorTests.cs | Adds test coverage for Windows symlink handling, mixed dirty states, and silent output behavior. |
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.
Fix Windows tool-managed entries in repository dirty check
Summary
This PR updates the repository dirty-state validation to better handle Windows-specific tool-managed files inside agent directories such as
.claude,.agent,.agents,.cursor,.winsurf,.windsurf,.opencode, and.codex.With the growing use of AI skills, local tooling may install shared skill content into these directories. Tools such as
skillsfromskills.shcan create symlinks instead of duplicating files. On Windows, LibGit2Sharp may report these entries as dirty even though they are tool-managed and should not blockversionize. The validator now ignores:DeletedFromWorkdirentries in those directories when the file still exists on diskThe command still warns the user when such entries are detected and continues to fail for actual dirty files outside the supported cases.
Motivation
versionizecould incorrectly stop before execution on Windows when AI skill tooling installed shared files into agent directories using symlinks or similar file-system behavior. In practice, this forced users to fall back to--skip-dirty, even though bypassing the dirty check should not be the default path for normal usage.In real repositories, Git CLI could report a clean working tree while LibGit2Sharp still surfaced false-positive dirty entries for those tool-managed paths. This change aligns validation with that real-world scenario without weakening normal dirty-repository protection.
Changes
testSymLinkfolderDeletedFromWorkdirentries that still exist on diskTesting
dotnet test Versionize.Tests/Versionize.Tests.csprojdotnet "D:\git\versionize\Versionize\bin\Debug\net10.0\Versionize.dll" --workingDir "D:\git\#wgtApp\WgtApp.Management" --dry-runNotes