@diegopetrucci/pi-dirty-repo-guard
v0.1.8
Published
A pi extension that prompts before session changes when the current git repo has uncommitted changes.
Readme
dirty-repo-guard
A small pi extension that prompts before session changes when the current git repo has uncommitted changes.
This is copied from the original dirty-repo-guard.ts example in earendil-works/pi and kept basically the same.
What it checks
Before creating a new session, switching sessions, or forking, the extension runs:
git status --porcelainIf the command reports changed files, pi asks whether to proceed anyway. If pi is running without an interactive UI, matching actions are cancelled by default.
Install
Standalone npm package
pi install npm:@diegopetrucci/pi-dirty-repo-guardCollection package
pi install npm:@diegopetrucci/pi-extensionsGitHub package
pi install git:github.com/diegopetrucci/pi-extensionsThen reload pi:
/reloadNotes
- Hooks
session_before_switchandsession_before_fork. - Allows session changes outside git repos.
- Cancels the action when the user declines.
