Git locks#111
Merged
Merged
Conversation
Adds git lock detection to prevent unnecessary processing during branch switches, merges, and rebases. When a git lock is detected: - Sets isRepositoryLocked flag to stop all file processing - Clears pending files queue to prevent stale injections - Notifies user that rebuild is required to resume - Automatically resets when app reconnects (after rebuild) This prevents injection attempts when the app state no longer matches the source code, improving reliability during git operations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Based on review feedback, moved git lock detection to use FileWatcher pattern matching instead of checking on every injection: - Extend FileWatcher.INJECTABLE_PATTERN to include .lock files - Detect lock files in InjectionHybrid.inject(source:) only - Keep NextCompiler unchanged - no overhead on SourceKit monitoring path - Clear pending queue and stop processing when lock detected - Auto-reset on client reconnect (rebuild) This approach is more efficient and only affects the FileWatcher code path, making it long-overdue filtering for file watching injection. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Show message on every injection attempt while locked (not just once) - Change "rebuild" to "relaunch" for clarity - Users see feedback each time they save a file during git operations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Replaced time-based window with deterministic lock existence check: - When git lock detected, store path for later checking - When source file changes, check if lock still exists on disk - If lock exists: source changing during git op = lock processing - If lock gone: was just a commit = allow processing This avoids false positives from commits while accurately detecting branch switches, merges, and rebases without arbitrary timeouts.
…po-processing-011CULzXF2cD361ofQbhXUf2 Merging now so I can add commits. Stop file processing when git repository is locked
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.
No description provided.