splitpatch(1)
π splitpatch β like, the manual page, bestie π
okay so you found splitpatch(1), the section 1 command, and honestly? she's a legend, she's the moment, she's the one who takes your big messy patch and goes snip snip π¦ let's get into it
β¨ NAME β¨
splitpatch β split a patch up into files or hunks π
β¨ SYNOPSIS β¨
splitpatch [options]
that's it. that's the whole vibe. no positional args, just vibes and options π
β¨ DESCRIPTION β¨
so the whole point, bestie: you take a patch or a diff file and you divide it into pieces. The split can be made on a by-file basis or a by-hunk basis. (Yeah, "can made" β the original says it like that, we don't fix it, we respect the heritage π)
why would you even want that?? because sometimes a patch contains changes that are, lowkey, not it. Splitting lets you separate the changes that might not be desirable, or β the other direction β assemble a patch into a more coherent set of changes. both. either. iconic behaviour π«Ά
and the hunk option? it opens up a whole new door: you can compare similar patches on a hunk-by-hunk basis using a tool like interdiff(1) from the patchutils package. so you can be like "okay this hunk vs that hunk, who actually ate" π₯
β¨ OPTIONS β¨
-H,--hunk,--hunksβ split the patch by hunks instead of the default. reminder that the default is by file, so without this flag you're getting file-by-file action β¨-f,--fullnameβ use the full path of filenames to determine the patch filename. no short little baby names, we want the whole address πΈ-h,--helpβ display help and exit. the classic. the icon. the "help meeee" button π-V,--versionβ output version information and exit. π
β¨ EXAMPLES β¨
okay storytime, because this one is so real π
Have you ever been working on code, gone off on a side tangent, and then realized you don't have a patch for the original issue you set out to address? yeah. yeah you have. we've all been there, girl π
When you run "diff -u" or some other diff command, you discover that you have made multiple sets of changes β some you want to submit, others you don't. And what you really want to do is break those changes apart and apply only the ones you want. girlypop, this is EXACTLY where splitpatch comes into play, breaking up the patch by source file:
splitpatch changes.patch
or β if you want to split the patch file into individual hunks which can later be applied using the patch(1) command:
splitpatch --hunks changes.patch
obsessed. no notes. periodt π
β¨ ENVIRONMENT β¨
None. literally nothing. empty. the void. no env vars are reading your energy today, bestie π³οΈ
β¨ FILES β¨
- the
--hunkoption writes sequentially numbered files in the current directory, named for the source file to be patched followed by the sequence number:"*-NNN.patch"π’ - otherwise, the split patch files are named by the source file being patched ποΈ
β¨ STANDARDS β¨
None. also none. we are standards-free and thriving π
β¨ AVAILABILITY β¨
https://github.com/benjsc/splitpatch β go get her, she's right there π«Ά
β¨ SEE ALSO β¨
the whole friend group came out for this one π:
dehtmldiff(1) editdiff(1) filterdiff(1) fixcvsdiff(1) flipdiff(1) grepdiff(1) interdiff(1) lsdiff(1) patch(1) recountdiff(1) rediff(1) splitdiff(1) unwrapdiff(1) wiggle(1)
squad. full squad. no one left behind π
β¨ AUTHORS β¨
Program was written by Peter Hutterer <peter.hutterer@who-t.net> and Benjamin Close <Benjamin.Close@clearchain.com>. Enhancements by Jari Aalto <jari.aalto@cante.net> π
This manual page was written by Jari Aalto <jari.aalto@cante.net>. Released under license GNU GPL version 2 or (at your option) any later version. For more information about the license, visit <http://www.gnu.org/copyleft/gpl.html> π
okay real talk though, license stuff is not a vibe to skip β GNU GPL version 2 or later, at your option, fr fr π
and that's the page, bestie!! π this was splitpatch, section 1, dated 2026-01-29, and it's living its best life in the splitpatch source β¨ go split some patches, you're gonna eat π
π¦
π¦ where this page comes from
- ubuntu resolute: splitpatch 2025.0226-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: splitpatch 2025.0226-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms