Skip to main content

Crate codex_apply_patch

Crate codex_apply_patch 

Source

Structs§

AffectedPaths
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, preserving the path spelling from the patch for user-facing summaries.
AppliedPatchChange
A committed file change, preserved in the order it was applied.
AppliedPatchDelta
Textual file changes that were actually committed while applying a patch.
ApplyPatchAction
ApplyPatchAction is the result of parsing an apply_patch command. By construction, all paths should be absolute paths.
ApplyPatchArgs
Both the raw PATCH argument to apply_patch as well as the PATCH argument parsed into hunks.
ApplyPatchFailure
A failed patch application together with the textual mutations that were definitely committed before the failure was observed.
ApplyPatchFileUpdate
Intended result of a file update for apply_patch.
IoError
StreamingPatchParser
UpdateFileChunk

Enums§

AppliedPatchFileChange
ApplyPatchError
ApplyPatchFileChange
Hunk
MaybeApplyPatchVerified
ParseError

Constants§

CODEX_CORE_APPLY_PATCH_ARG1
Special argv[1] flag used when the Codex executable self-invokes to run the internal apply_patch path.

Functions§

apply_hunks
Applies hunks and continues to update stdout/stderr
apply_patch
Applies the patch and prints the result to stdout/stderr.
main
maybe_parse_apply_patch_verified
cwd must identify an absolute environment-native path so relative patch paths can be resolved without projecting them onto the app-server or exec-server host.
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
verify_apply_patch_args