{"id":28178751,"url":"https://github.com/rec/psplit","last_synced_at":"2025-06-12T00:35:05.427Z","repository":{"id":285094000,"uuid":"957052096","full_name":"rec/psplit","owner":"rec","description":"✂️ `psplit`: Split git patch files ✂️","archived":false,"fork":false,"pushed_at":"2025-06-05T17:23:02.000Z","size":57,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T06:13:17.036Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rec.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-03-29T12:45:40.000Z","updated_at":"2025-06-05T17:23:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"21a281bd-20f7-486e-a61e-f72e8bc082ea","html_url":"https://github.com/rec/psplit","commit_stats":null,"previous_names":["rec/split_patch","rec/psplit"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rec/psplit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fpsplit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fpsplit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fpsplit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fpsplit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rec","download_url":"https://codeload.github.com/rec/psplit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rec%2Fpsplit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259371306,"owners_count":22847556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-16T01:13:30.137Z","updated_at":"2025-06-12T00:35:05.375Z","avatar_url":"https://github.com/rec.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ✂️ `psplit`: Split git patch files ✂️\n\n## Usage\n\n```\npsplit [-h. --help]\n       [-c, --clean]\n       [-d, --directory DIRECTORY]\n       [-h, --hunks HUNKS]\n       [-j, --join-character JOIN_CHARACTER]\n       [-p, --parts PARTS]\n       [files ...]\n```\n\n### Positional arguments\n```\n  files                 Files to split (or split stdin if no files)\n```\n\n### Optional arguments\n\n```\n  -h, --help            show this help message and exit\n  --clean               Clean --directory of patch files\n  --directory DIRECTORY, -d DIRECTORY\n                        Output to this directory (create if needed)\n  --hunks HUNKS, -u HUNKS\n                        Split into parts containing this many hunks\n  --join-character JOIN_CHARACTER, -j JOIN_CHARACTER\n                        The character to replace / in filenames\n  --parts PARTS, -p PARTS\n                        Split into this many parts\n```\n\n## How it works\n\n`psplit` is a utility to split large git patch files. It is a single file\nwith no dependencies except Python 3.9 or greater.\n\n`psplit` splits its inputs by file, then each file is split into one or more\npatches. Each output patch file gets a unique name derived from the\nunderlying file name.\n\nTo avoid clutter, use the `--directory`/`-d` flag, which creates a\nsubdirectory if needed and puts the new patches in it.\n\nIf you set `--parts/-p`, `psplit` will split each file into that many parts:\neach file gets the same number of parts.\n\nIf you set `--hunks/-u`, `psplit` will split each file into parts containing\nthat many hunks: larger files will get more parts.\n\n(A hunk is a small, self-contained delta for a single text file.  A patch\ncontains zero or more files, each file containing one or more hunks.)\n\nIf neither flag is set, `psplit` will use the square root of the number of\nhunks in the file, the geometric median between all the hunks in one part\nand one hunk per part.\n\n## Example\n\n```\n$ g diff HEAD~ | psplit -d patches\nCreating patches/\nWriting patches/tools-linter-adapters-_linter.py.patch\nWriting patches/tools-linter-adapters-_linter-__init__.py.patch\nWriting patches/tools-linter-adapters-_linter-argument_parser.py.patch\nWriting patches/tools-linter-adapters-_linter-block.py.patch\nWriting patches/tools-linter-adapters-_linter-blocks.py.patch\nWriting patches/tools-linter-adapters-_linter-bracket_pairs.py.patch\nWriting patches/tools-linter-adapters-_linter-file_linter.py.patch\nWriting patches/tools-linter-adapters-_linter-file_summary.py.patch\nWriting patches/tools-linter-adapters-_linter-messages.py.patch\nWriting patches/tools-linter-adapters-_linter-python_file.py.patch\nWriting patches/tools-linter-adapters-_linter-sets.py.patch\nWriting patches/tools-linter-adapters-docstring_linter.py-1.patch\nWriting patches/tools-linter-adapters-docstring_linter.py-2.patch\nWriting patches/tools-linter-adapters-docstring_linter.py-3.patch\nWriting patches/tools-linter-adapters-set_linter.py-1.patch\nWriting patches/tools-linter-adapters-set_linter.py-2.patch\nWriting patches/tools-test-test_docstring_linter.py.patch\n```\n\n## How to install\n\nEither use `pip`: `python -m pip install psplit`. Or simply download the file\n`psplit.py` and put it into your path.\n\n\n## Other alternatives\n\nhttps://manpages.ubuntu.com/manpages/xenial/man1/splitpatch.1.html didn't work\nwell for large files and isn't available on Mac OS\n\nhttps://pypi.org/project/splitpatch/ is complicated and very new\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Fpsplit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frec%2Fpsplit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frec%2Fpsplit/lists"}