Skip to main content

Fixes erroneous git apply patches to the best of its ability.

Project description

patch-fixer

So you asked an LLM to generate a code diff, tried to apply it with git apply, and got a bunch of malformed patch errors? Well fear no more, patch_fixer.py is here to save the day... more or less.

Installation

git clone https://github.com/ajcm474/patch-fixer.git
cd patch-fixer
pip install -e .

Usage

python patch_fixer.py original broken.patch fixed.patch

where original is the file or directory you were trying to patch, broken.patch is the malformed patch generated by the LLM, and fixed.patch is the output file containing the (hopefully) fixed patch.

Testing

Assuming you've already cloned the repo:

pip install -e .[test]
pytest

Note that some tests currently fail as this project is in the early alpha stage.

License

This is free and open source software, released under the Apache 2.0 License. See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

patch_fixer-0.2.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

patch_fixer-0.2.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file patch_fixer-0.2.2.tar.gz.

File metadata

  • Download URL: patch_fixer-0.2.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for patch_fixer-0.2.2.tar.gz
Algorithm Hash digest
SHA256 57236a99b42ab60fafa37972e6cb2933bb340a8df6838f0f2209bc21b7916afb
MD5 cb8fda769af94b2f3ac1d099ae9eac06
BLAKE2b-256 32775906c5f7e901356fd2ac812b4aba71e4f9234446c7ebb06f31ebd5fb26a4

See more details on using hashes here.

File details

Details for the file patch_fixer-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: patch_fixer-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for patch_fixer-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 312e9d9e8f451fd66bb1c7b4e4fdc3f6829fa82a42527072ab9017fdb6580a17
MD5 907f023d150ebac82730c606eae95828
BLAKE2b-256 8dc7b7569426a52607a063a7c65807682d7596e4b81897abfca0b2650439cac4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page