ftw-patch: Unicode-Safe & Whitespace-Aware Patching¶
—
ftw-patch is a robust Python-based patch utility designed for modern
development workflows. While traditional patch tools often struggle with different
line endings, Unicode characters, or minor formatting changes, ftw-patch
provides advanced normalization to make patching reliable and predictable.
Key Features¶
Unicode-Safe: Native handling of UTF-8 and other encodings without corruption.
Smart Normalization: Optional ignore/normalize rules for non-leading whitespace and blank lines.
Context-Aware: Dynamically loads configuration from
pyproject.tomlor user-defined files.Safety First: Built-in dry-run mode and flexible backup options (including timestamped suffixes).
Cross-Platform: Consistent behavior on Linux, macOS, and Windows.
Installation¶
Recommended: Global Installation via pipx¶
For most users, we recommend installing the application using pipx. It installs the package into a dedicated, isolated environment while making the executable available globally in your shell.
Why pipx?
Isolation: Prevents dependency conflicts with other Python packages or your system’s Python.
Cleanliness: No more cluttering of your global site-packages.
Convenience: Binaries are automatically added to your PATH.
pipx install ftw-patch
Developer Installation (pip)¶
If you intend to use the package as a library or want to contribute to development, use a standard virtual environment:
# Create and activate a venv
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install the package
pip install ftw-patch
Quick Start¶
Once installed, use the ftwpatch command to apply a unified diff:
ftwpatch my_changes.patch
Documentation¶
User Guide:
Developer Guides:
Externel Components
Project Information:
Indices and tables¶
Licensed under
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International