01 / Reproduce
Check the same patch against both files
Install Git if needed. Extract the practice ZIP into a new folder outside any Git repository. Open PowerShell in the folder containing proposal.patch and run each line in order. -C makes Git run from the named subfolder, so the patch can find agent.conf there.
git -C original apply --stat ../proposal.patch
git -C original apply --check ../proposal.patch
$LASTEXITCODE
git -C current apply --check ../proposal.patch
$LASTEXITCODE
The stat shows one file with one insertion and one deletion. The original check prints nothing and returns 0. In the current folder, Git reports that the patch does not apply to agent.conf and returns a nonzero exit code. Both settings files keep their original bytes.
Open proposal.patch. The lines around the timeout edit tell Git where the edit belongs. One of those context lines says route=review. The newer file says route=manual-review in that spot.
02 / Inspect
Refresh the patch against the current file
Open refreshed.patch and check its intent. Its context now includes the current route. The only added and removed settings lines still change the timeout from 5 to 10.
@@ -2,7 +2,7 @@
mode=draft
route=manual-review
format=text
-timeout_seconds=5
+timeout_seconds=10
retries=0
log=local
approval=required
Run the check against the current copy, then apply the reviewed patch inside the disposable fixture if Git reports success.
git -C current apply --check ../refreshed.patch
if ($LASTEXITCODE -eq 0) {
git -C current apply ../refreshed.patch
}
Get-Content ./current/agent.conf
In the resulting file, route=manual-review stays in place and timeout_seconds=10 appears. Re-extract the practice ZIP into a fresh folder to run the full exercise again.
03 / Make it your own
Change a line outside the patch
- Copy the
originalfolder to a new folder namedadapted. - In
adapted/agent.conf, change the last line toowner=operations. Save with LF line endings. - Run the original check against that folder. Compare the exit code with the check against
current.
git -C adapted apply --check ../proposal.patch
$LASTEXITCODE
The check returns 0. In this fixture, owner is outside the edited lines and their context. Use that distinction to decide which parts of a real patch deserve closer review as the underlying files evolve.
Boundaries
Use the check in your own repository
From the repository root, inspect which files the proposed patch touches and read its edits. Run git apply --check path/to/proposal.patch against the working tree you intend to change. If the check fails, start from the current source and make a fresh diff after reviewing the edit. Git can write that diff directly with git diff --output=proposal.patch -- path/to/file when the tracked file has an unstaged edit.
A passing check answers whether Git can apply the patch to the current files. Run the relevant project tests after applying it to verify the requested behavior. This lab exercised applicability and the resulting fixture bytes. Model output, agent behavior, and performance were outside the exercise.
Primary sources / Checked November 13, 2026
Read the Git references
- How
--checkand--statinspect a patch without applying it. Git apply options - How patch output, surrounding context, and direct file output work. Git diff options
- How to run a command as if started in another directory. Git command options
Downloads / Practice and social files

