feat(sdk): add --respect-staged opt-in to gsd-sdk query commit --files (#3522)
Closes #3522. When --respect-staged is passed the git add loop is skipped entirely so per-hunk staging from git add -p is preserved. Default behavior (full re-stage) is unchanged. The #3061 pathspec invariant holds under both modes. Nothing-staged within scope returns { committed: false, reason: 'nothing staged' } without error. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
5
.changeset/kind-foxes-click.md
Normal file
5
.changeset/kind-foxes-click.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
type: Added
|
||||
pr: 3522
|
||||
---
|
||||
**`gsd-sdk query commit --files` gains `--respect-staged` opt-in** — pass `--respect-staged` to skip the automatic `git add` step and commit only what is already staged within the requested pathspec. Callers using `git add -p` to stage individual hunks no longer have their partial staging silently overwritten. Without the flag, default behavior is unchanged (#3061 invariant preserved under both modes).
|
||||
Reference in New Issue
Block a user