patchinput

package
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package patchinput verifies a complete patch directory and freezes its declared bytes into private staging. It never applies a patch or starts a process.

The supported format is unified text: ---/+++ headers followed by one or more counted @@ hunks, with LF line endings. A header may have a tab followed by a GNU diff timestamp. Multiple file sections and the standard no-newline marker are supported. Both header paths are validated after stripping exactly one component; modifications must name the same target. /dev/null is accepted only for a complete, single-hunk addition or deletion.

A standard Git text envelope is also supported: diff --git, optional regular new/deleted file mode, and index metadata. Both wrapper paths must match the text headers after strip=1. Only regular modes 100644/100755 are descriptive; when both operation and index metadata specify modes, they must agree. Existing intended permissions remain unchanged and all new files use 0644. Git blob IDs in index lines are descriptive, not authenticated provenance.

Paths containing whitespace, quotes, controls or backslashes are unsupported. Mail/Index prologues, binary data, mode changes, links, renames, context/normal diffs, unexplained leading/trailing text and malformed hunk counts are rejected before an executor can receive the staged series. Plain unified diffs can be produced with diff -u --label a/path --label b/path old-file new-file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inventory

type Inventory struct{}

Inventory implements the version 1 patch-preparation contract. Callers provide a validated declaration, retained confined input view and private staging directory. Every returned file belongs to a new private child of StagingDir; the owner removes that staging tree after execution or cancellation.

func (Inventory) Prepare

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL