Stage chosen hunks
git_commit_stageStages exactly the named hunks from a git_commit_read listing into the Git index and uses the listing digest to reject stale diffs. Leaves the working tree untouched; stage binary files whole.
Instructions
Stage exactly the named hunks of a git_commit_read hunks listing into the index. Pass the listing's digest with the ids and the same paths: the call recomputes the diff and stages nothing when it differs from the listing, so a stale listing never stages other hunks. The working tree is untouched. Ids are positions in one listing, so list again after staging. A binary file cannot be staged by hunk; stage it whole with git add.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"digest": "<digest>",
"hunks": "<hunks>"
},
"name": "git_commit_stage"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hunks | Yes | The ids of the hunks to stage, from that listing; a repeated id is staged once. | |
| paths | No | The same files or directories the listing was made with, relative to the working tree root. | |
| digest | Yes | The digest of the git_commit_read hunks listing the ids come from. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| root | Yes | The absolute path of the working tree root. | |
| files | Yes | Every file the index now changes against HEAD, including what was staged before this call. | |
| staged | Yes | The ids of the hunks that were staged, ascending. |