Structs§
- Affected
Paths - Applies each parsed patch hunk to the filesystem. Returns an error if any of the changes could not be applied. Tracks file paths affected by applying a patch.
- Apply
Patch Action - ApplyPatchAction is the result of parsing an
apply_patch
command. By construction, all paths should be absolute paths. - Apply
Patch Args - Both the raw PATCH argument to
apply_patch
as well as the PATCH argument parsed into hunks. - Apply
Patch File Update - Intended result of a file update for apply_patch.
Enums§
Constants§
- APPLY_
PATCH_ TOOL_ INSTRUCTIONS - Detailed instructions for gpt-4.1 on how to use the
apply_patch
tool.
Functions§
- apply_
hunks - Applies hunks and continues to update stdout/stderr
- apply_
patch - Applies the patch and prints the result to stdout/stderr.
- maybe_
parse_ apply_ patch - maybe_
parse_ apply_ patch_ verified - cwd must be an absolute path so that we can resolve relative paths in the patch.
- parse_
patch - print_
summary - Print the summary of changes in git-style format. Write a summary of changes to the given writer.
- unified_
diff_ from_ chunks - unified_
diff_ from_ chunks_ with_ context