Skip to content

[ENHANCEMENT] Add Git context collector for commit-message generation #282

Description

@edelauna

Problem (one or two sentences)

Zoo needs a safe, scriptable way to inspect Git changes before AI commit generation can work.

Part of #145.

Context (who is affected and when)

Developers may have staged, unstaged, renamed, copied, deleted, binary, or untracked files when preparing a commit from VS Code Source Control.

Desired behavior (conceptual, not technical)

Zoo can collect commit-relevant Git context without using Zoo file ignore filters, preferring staged changes and falling back to unstaged changes only when nothing is staged.

Constraints / preferences (optional)

Use stable, machine-readable Git output and path-safe parsing. Avoid shell-string interpolation for file paths.

Request checklist

  • I've searched existing Issues and Discussions for duplicates
  • This describes a specific problem with clear context and impact

Zoo Code Task Links (optional)

No response


Optional (for contributors): You can stop here if you're just proposing the improvement.

Acceptance criteria (optional)

  • Staged changes are used when present.
  • Unstaged and untracked changes are used only when no staged changes exist.
  • Added, modified, deleted, renamed, copied, binary, and untracked files are represented safely.
  • Zoo ignore filters are not applied to this Git-source-of-truth workflow.
  • Unit tests cover parsing and staged/unstaged precedence.

Proposed approach (optional)

Add a Git context collector independent of VS Code UI and AI generation. Prefer Git porcelain/name-status formats and test the parser directly.

Trade-offs / risks (optional)

Path parsing is the main risk, especially renamed/copied paths and paths containing whitespace or unusual characters.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions