Summary
src/commands/batch.ts reimplements change detection, diff retrieval, and committing with bare git, temp files, and no untracked-file support — diverging from the canonical logic in src/git/diff.ts (resolveGitExecutable(), getUntrackedDiff(), 100MB buffer, git commit -F). This duplication has already produced divergent behavior (batch skips untracked-only repos) and will keep drifting as fixes land on one path only.
Location
src/commands/batch.ts:64-105 — gitHasChanges() / getGitDiff() duplicate src/git/diff.ts getStagedDiff() / getUnstagedDiff()
src/commands/batch.ts:110-135 — gitCommit() duplicates src/git/diff.ts commit()
- Shared helpers already exist in
src/git/diff.ts (getStagedDiff, getUnstagedDiff, commit)
Suggested fix
Reuse getStagedDiff() / getUnstagedDiff() / commit() from src/git/diff.ts inside batchCommand, removing the local helpers. The batch layer should only add the repo iteration logic, not git plumbing.
Impact
- Two independent git code paths for the same operations; bug fixes and features (untracked files, executable resolution, diff limits) must be applied twice.
- Directly caused the batch untracked-files bug and the bare-
git inconsistency.
Summary
src/commands/batch.tsreimplements change detection, diff retrieval, and committing with baregit, temp files, and no untracked-file support — diverging from the canonical logic insrc/git/diff.ts(resolveGitExecutable(),getUntrackedDiff(), 100MB buffer,git commit -F). This duplication has already produced divergent behavior (batch skips untracked-only repos) and will keep drifting as fixes land on one path only.Location
src/commands/batch.ts:64-105—gitHasChanges()/getGitDiff()duplicatesrc/git/diff.tsgetStagedDiff()/getUnstagedDiff()src/commands/batch.ts:110-135—gitCommit()duplicatessrc/git/diff.tscommit()src/git/diff.ts(getStagedDiff,getUnstagedDiff,commit)Suggested fix
Reuse
getStagedDiff()/getUnstagedDiff()/commit()fromsrc/git/diff.tsinsidebatchCommand, removing the local helpers. The batch layer should only add the repo iteration logic, not git plumbing.Impact
gitinconsistency.