$ show timbrel/GitSavvy
GitSavvy is a full-featured Git plugin for Sublime Text, providing an extensive keyboard-driven interface for common Git operations. It includes a status dashboard, diff viewer, inline diff, commit view, log graph with interactive rebase, blame, branch/tag management, stash management, and integrations with GitHub and GitLab for pull/merge requests and remote operations. The architecture is built on a mixin-based command system, an asynchronous runtime for UI/worker thread management, and a reactive UI framework for dashboard views. It leverages custom Sublime Text syntax highlighting for Git-specific views and is highly configurable via settings. The codebase demonstrates strong engineering practices with well-structured modules, caching patterns, and extensive test coverage, though it is tightly coupled to the Sublime Text API and has some legacy dependencies (e.g., Python 3.8 requirement, deprecated `imp` module usage).
The LLM identified 4 files worth highlighting for reuse:
Provides a reusable async runtime for Sublime Text plugins, including functions like `enqueue_on_ui`, `on_worker`, `cooperative_thread_hopper`, and `throttled`. These enable non-blocking UI updates and background Git operations. The pattern is isolated and could be extracted for any Sublime plugin requiring thread-safe UI communication.
Implements caching decorators (`@cached`, `@cache_in_store_as`, `@cached_until_focus_switch`) and an LRU cache for optimizing repeated Git queries. The design is generic and could be reused in any Python project needing caching with invalidation conditions.
Provides `SplittedDiff` and `Hunk` classes to parse `git diff` output into structured, navigable components. It handles combined diffs, file headers, and hunk headers. The parsing logic is self-contained and could be reused in any tool that needs to programmatically analyze git diffs.
Offers a `ThemeGenerator` abstraction that creates both legacy `.tmTheme` XML and modern `.sublime-color-scheme` JSON color schemes for GitSavvy views. Demonstrates a clean pattern for generating Sublime Text themes programmatically, adaptable for other plugin developers needing custom syntax highlighting.