-
Notifications
You must be signed in to change notification settings - Fork 1
Add --staged and --diff flags for git workflows #20
Copy link
Copy link
Closed
Description
Summary
Add git-aware flags to reduce shell piping in common CI/pre-commit workflows.
Motivation
Currently users must pipe git output:
git diff --name-only main | loq check -Native flags make the common case easy:
loq check --staged
loq check --diff mainDesign
New flags (on check command):
--staged- Check only files in the git staging area--diff <ref>- Check files changed since ref (e.g.,main,origin/main..HEAD)
Behavior with paths: Intersect
loq check src/ --stagedchecks only staged files withinsrc/- This is the most intuitive behavior
Git not available: Hard error with helpful message
- "error: --staged requires git, but git is not available"
Implementation notes:
- Shell out to
git diff --name-onlyunder the hood - Reuse existing stdin/path-list logic
- Filter to only files (not directories) that exist
Tasks
- Add
--stagedflag to check command - Add
--diff <ref>flag to check command - Implement git command execution
- Handle intersection with path arguments
- Add clear error when git unavailable
- Integration tests for git workflows
- Document in README
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels