Git Status Plugin
Automatically tracks git branch and status by parsing git command output. Shows branch information in notifications and can update a status bar.
Features
- Detects branch switches
- Parses git status output
- Tracks repository state
- Low performance impact
- No external git calls
Installation
just plugin-build git-statusConfiguration
Add to your ~/.config/scarab/config.toml:
[[plugins]]
name = "git-status"
enabled = true
[plugins.config]
notify_branch_change = true
show_status = true
update_frequency = 10Usage
The plugin monitors git command output automatically:
# Initialize a repo
git init
git status # Plugin detects branch: main
# Create and switch branches
git checkout -b feature/awesome
# Plugin notifies: ⎇ feature/awesome
# Check status
git status
# Plugin updates internal stateHow It Works
- Monitors all terminal output for git command responses
- Uses regex to parse branch names and status
- Stores current git state in plugin data
- Sends notifications on important changes
- Can send updates to frontend for status bar display
Detected Patterns
On branch <name>- git status outputSwitched to branch '<name>'- git checkout outputYour branch is <status>- upstream comparison
Future Enhancements
- Direct git repository monitoring (libgit2)
- File change indicators
- Commit count display
- Stash tracking
- Integration with status bar widget
License
MIT