git_commit
Record reviewed edits by staging specified files and creating a local Git commit; supports branch checkout and confirmation checkpoints without pushing.
Instructions
Stage the named files and create a Git commit within the session budget. Use when: edits have been reviewed and should be recorded in local Git history. Don't use when: you need to apply or test a patch first (use write_fix instead).
Returns {success, commit_hash, branch, files_committed, error}. A checkpoint additionally returns needs_confirmation=true and message; retry with confirmed=true after approval. files_committed echoes the requested list, not an inventory of the commit: previously staged changes are also committed. Refuses an empty commit when the staged index matches HEAD; refusals do not consume the session budget. Initial commits with staged content are allowed. May create/check out a branch and invoke Git hooks; does not push.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | Yes | Required nonempty list of files to stage, relative to repo_path or absolute within it; e.g. ['src/main.py']. Already staged changes are also included by Git's index commit; inspect the index first. | |
| branch | No | Branch name to check out before staging; default null stays on the current branch. Must exist unless create_branch is true. | |
| message | No | Commit message; null (default) or an empty string uses 'refactor: automated fix #N', with N the next per-repository session count. | |
| confirmed | No | Default false. Set true on retry after needs_confirmation is returned and the user approves. Does not bypass session_budget (default 20 commits); checkpoints default to every 5 commits via reforge.toml. | |
| repo_path | Yes | Git repository directory to commit in; prefer an absolute path, e.g. /work/app. | |
| create_branch | No | Default false. When true and branch is supplied, create and check out that branch; without branch this flag has no effect. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | Yes | ||
| branch | Yes | ||
| message | No | ||
| success | Yes | ||
| commit_hash | Yes | ||
| files_committed | Yes | ||
| needs_confirmation | No |