Skip to content

Systematic: shell syntax in git.run() calls across 8+ tools #172

Closed

Description

@TerminalGravity

Problem

run() in lib/git.ts uses execFileSync('git', args) — no shell interpretation. But many tools pass strings containing shell operators that silently break:

  • 2>/dev/null — passed as literal git args
  • || fallback — not executed, literal args
  • | tail -1 / | grep — literal args
  • && git commit — literal args
  • < file — literal args
  • git diff ... — becomes git git diff ...

Already fixed

Still broken

Tool Line(s) Shell syntax used
verify-completion 37, 58, 83, 115, 133 cat, pipe, 2>/dev/null, npm run build via git
token-audit 42-43, 66, 83, 142 2>/dev/null, wc -l <, tail -c
session-handoff 11, 47 command -v, gh pr list ... || echo
audit-workspace 39, 78 2>/dev/null, find ... | wc -l
sharpen-followup 90 2>/dev/null
scope-work 131 git ls-files | head | grep
enrich-agent-task 32-56 2>/dev/null, head -30, grep pipes
sequence-tasks 93 2>/dev/null

Fix approach

For each tool:

  1. Replace shell-piped commands with array-arg run() calls
  2. Do filtering/piping in JS (split, filter, slice)
  3. For non-git commands (wc, find, cat), use Node.js fs/child_process directly
  4. Remove 2>/dev/null — run() already catches errors gracefully

Activity

  1. 4 remaining items

  2. added 13 commits that reference this issue on Mar 10, 2026
    07f4064
    245cd5d
    b1b3fc5
    1dd87f7
    2e0764e
    14b355f
    95c1752
    366f2aa
    c3100ca
    a4d20b5
    c03252e
    5b94aa0
    3b855be
  3. TerminalGravity commented on Mar 10, 2026

    @TerminalGravity
    CollaboratorAuthor

    Fixed in 3b855be (already on main). Closed 4 stale duplicate PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions