Skip to content

Git locks#111

Merged
johnno1962 merged 15 commits into
mainfrom
git-locks
Nov 9, 2025
Merged

Git locks#111
johnno1962 merged 15 commits into
mainfrom
git-locks

Conversation

@johnno1962
Copy link
Copy Markdown
Owner

No description provided.

claude and others added 15 commits October 21, 2025 20:57
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
@johnno1962 johnno1962 merged commit 4688c58 into main Nov 9, 2025
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.

2 participants