[RFC] xbps-src: add a command show-diff
#53950
Open
+12
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
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