summaryrefslogtreecommitdiff
path: root/rc/tools/patch.kak
AgeCommit message (Collapse)Author
2024-09-16patch-range.pl: extract peculiaritiesJohannes Altmanninger
We pipe the output of the patch program to stderr (to have it show up in *debug*) and print to stdout the remaining diff (the part of the diff that was not passed to patch). The next patch wants to use this script in a different way, so move these decisions up.
2024-02-01rc tools patch: figure out path to patch-range.pl without double-parsingJohannes Altmanninger
We double-parse a command definition to figure out the location of a support script at load time. This feels a bit dangerous and is not really necessary, so use %val{runtime}/rc/tools/... instead. Reference: https://lists.sr.ht/~mawww/kakoune/%3CZbOSCK2JjJvo-RTt@gmail.com%3E
2024-01-26rc patch.kak: fix quotingJohannes Altmanninger
I learned that $ foo="'1 2'" $ echo $foo '1 2' Quote some variables to avoid this double unescaping.
2023-12-04Perl files are not always executableLoric Brevet
2023-11-04rc tools patch: "patch" command to apply selections in diffs to fileJohannes Altmanninger
One of the features I miss most from Magit/Fugitive/Tig is to apply/revert/stage/unstage individual hunks or even exactly the selected line(s). This provides a much more convenient way of splitting changes than "git add/restore -p". Implement a "patch" command that applies the selected lines within a diff by piping them to the "patch" program. It can also feed other programs like "git apply" (see the next commit). Original discussion: https://discuss.kakoune.com/t/atomic-commits-in-kakoune/1446 Interestingly, :patch is defined outside the "patch" module. This is to make it readily available for interactive use. Putting it into the module does not save any work. I tentatively added a patch module anyway so we can explicitly declare this dependency.. although there is the argument that this is not really needed?