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 --hunk option 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