feat: improve git state handling and file watching #331
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.
Enhance edamagit status buffer to automatically update when git state changes occur outside of edamagit (e.g., via command line or VS Code source control). This improves the user experience by keeping the status display in sync with the actual repository state.
Key Features:
Intelligent State Tracking:
Monitors meaningful changes in git repository state
Tracks working tree, index, and merge change counts
Updates only when status actually changes
Prevents unnecessary refreshes while ensuring accuracy
Selective File Watching:
Filters temporary and lock files
Carefully handles git internal files
Catches important changes (HEAD, refs) while ignoring routine ones
Prevents update loops from status refresh operations
Safe Update Management:
Skips updates during rebase operations
Safely handles merge states with lock file checks
Protects git config access during updates
Gracefully handles concurrent operations
Smart Debouncing:
Clusters rapid changes to prevent overwhelming updates
Maintains minimum interval between updates
Cancels pending updates when new changes arrive
Uses efficient timeout and timestamp tracking