There's a closed pull request on the void-packages repository [RFC] xbps-src: add a command `show-diff` https://github.com/void-linux/void-packages/pull/53950 Description: Usage: ./xbps-src show-diff PKG Shows differences between the original sources and $wrksrc, in the form of a patch that can be used for the template. Note this ignores new files. #### Testing the changes - I tested the changes in this PR: **briefly** #### Alternatives One alternative suggested in irc is to use unpatch from https://leahneukirchen.org/dotfiles/bin/unpatch Save the original files as .orig, then run - `unpatch -g -p3 masterdir-*/builddir/pkg-ver` With vim, one can use `:set patchmode=.orig` Two more suggestions from irc related to this: - `alias xpatch="nvim -c 'set patchmode=.orig'"` - `autocmd BufNewFile,BufRead masterdir-*/builddir/* setlocal patchmode=.orig`