refactor(git): one runGit helper in git-diff-utils replaces the four local git() spawnSync wrappers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Refactor
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- git, node.js, typescript
Research direction
Read src/lib/workflow/git-diff-utils.ts and its test, then trace the four wrapper sites listed in the issue. Add the shared helper tests for success and failure, and run the listed Vitest commands plus npm run lint && npm run lint:health. Done means all four wrappers are replaced, caller failure behavior is preserved, and the checks pass.
Written by the indexing model from the issue text.
Description
Follow-up of #1520 (PR #1587); from the independent code review. This is the synchronous consolidation; the async move is #506 and stays there.
Problem
Four modules carry their own function git( wrapper over spawnSync("git", …): src/lib/skills-commit-state.ts:36 (returns null on failure), src/lib/worktree-isolation.ts:102 (takes the command as one string), src/lib/merge-check/combined-branch-test.ts:70 and src/lib/workflow/review-residue.post.ts:28 (both throw, with different error text; the last one picks a 64 MB maxBuffer, the others the default). grep -lE '^function git\(' <the four files> | wc -l → 4 today. Each copy drifts on its own: a change to how a failed git read is reported, or to the buffer a large diff needs, lands in one and not the others. src/lib/workflow/git-diff-utils.ts already hosts the shared git reads (resolveDiffBase, getCommitHash, getGitDiffStats) and is where one helper belongs.
Acceptance Criteria
- AC-1: One exported helper in
git-diff-utils.ts(for examplerunGit(cwd, args, { maxBuffer? }), throwing with one error shape) replaces the four local wrappers; each former site calls it and keeps its own failure policy at the call site (catch and returnnullwhere it did). Evidence:grep -lE '^function git\(' src/lib/skills-commit-state.ts src/lib/worktree-isolation.ts src/lib/merge-check/combined-branch-test.ts src/lib/workflow/review-residue.post.ts | wc -l | tr -d ' '→0(today4) - AC-2: The helper has its own test for the two outcomes (stdout on success; a thrown error that names the args and stderr on failure). Evidence:
npx vitest run src/lib/workflow/git-diff-utils.test.ts -t "runGit"→≥ 2 passed, 0 failed(new cases) - AC-3: The four callers' tests still pass. Evidence:
npx vitest run src/lib/skills-commit-state.integration.test.ts src/lib/worktree-isolation.test.ts src/lib/merge-check/combined-branch-test.test.ts src/lib/workflow/review-residue.post.test.ts→0 failed - AC-4: No function grows past the #1508 ratchet and no metric rises. Evidence:
npm run lint && npm run lint:health→ exit 0,no metric rose above the baseline
May touch
src/lib/workflow/git-diff-utils.ts and its test, the four listed files, CHANGELOG.
Non-Goals
- Making any of these async (#506).
- Touching
GitHubProvideror anyghcall (#1506). - No edits under
plugin/,.claude/skills/,templates/skills/(plugin freeze).
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- Avg merge
- 11h 3m
- Merged PRs (30d)
- 84
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sequant-io/sequant
-
graph-2026-11-simplify
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sequant-io/sequant#1650 ·
Maintainers usually reply within 1 day
-
run: --phases does not suppress the UI-label test phase (determinePhasesForIssue adds it to an explicit list)Possibly taken @admarble claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sequant-io/sequant#1631 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
sequant-io/sequant#1601 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sequant-io/sequant#1582 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 76/100
sequant-io/sequant#1381 ·
Maintainers usually reply within 1 day
All issues in sequant-io/sequant
Similar issues
-
content triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
tensorflow/tfjs#8754 ·
-
tool-submission
Difficulty 1/5 Under an hour Newbie friendliness 83/100
BraveOPotato/NoSignups#2348 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
code-yeongyu/oh-my-openagent#12784 ·
Maintainers usually reply within 1 day
-
external-issue to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 71/100
Maintainers usually reply within 1 day