SVK::Co...d::Patch(3)
β¨ NAME β¨
SVK::Command::Patch β manage patches π
(yeah bestie, this is the page for SVK::Co...d::Patch(3), that lil Perl manual thing π
)
πΈ SYNOPSIS πΈ
patch --ls [--list]
patch --cat [--view] PATCHNAME
patch --regen [--regenerate] PATCHNAME
patch --up [--update] PATCHNAME
patch --apply PATCHNAME [DEPOTPATH | PATH] [-- MERGEOPTIONS]
patch --rm [--delete] PATCHNAME
Like, look at all those little aliases. She has so many names and honestly? iconic. π
π¦ OPTIONS π¦
--depot DEPOTNAMEβ do the thing on a depot that is not</> the default one. That's it, that's the whole option, go wild. β¨
π DESCRIPTION π
Okay so, wanna make a patch? You don't type some special patch-making command, no ma'am β you use commit -P or smerge -P. That's the move. π«Ά
And if somebody sends you a patch? You literally just drop it into the patch directory inside your local svk repository. That's usually ~/.svk/, for the record. No ceremony, no fuss, just vibes and file placement. π
svk patches are compatible with GNU patch, which is great. The extra svk-specific metadata gets stashed in an encoded chunk at the end of the file. So there's a little secret tail on every patch, iykyk. π§
Also, super important: if you use a patch name of -, that means the standard input and output. Not a file literally named dash. Respect the dash. π
π INTRODUCTION π
So here's the whole situation that svk patch is here to save you from: you wanna maintain your own patchset against some project, but you have no direct write access to the remote repository β which means svk push is just not an option for you. Sad! But not the end of the story. π
Let's say you mirror project foo to //mirror/foo, you make a local copy on //local/foo, and you check it out to ~/dev/foo. Then you do some work, and you're feeling yourself, so you type:
svk commit -m "Add my new feature"
That commits your changes from ~/dev/foo into //local/foo. Now β if you do have commit access to the upstream repository, you can just yeet your changes straight up there like this:
svk push //local/foo
But sometimes it's genuinely more useful to send a patch instead of submitting changes directly. Maybe because you don't have permission to commit upstream, or maybe because you don't think your changes are ready to be committed yet. Both valid! No judgement! π
So to create a patch containing the differences between //local/foo and //mirror/foo, you run:
svk push -P Foo //local/foo
That -P flag is the whole trick β it tells svk "bestie, I want a patch, not a push to the upstream repo." And -P takes a single flag: a patch name. It probably makes sense to name it after the feature you implemented or the bug you fixed, so future you isn't squinting at patch_7_final_FINAL like an idiot. The patch files you generate get created in the patch subdirectory of your local svk repository. π
Now, over time, other developers are gonna make changes to project foo, because the world does not stop for anyone. And from time to time you'll need to update your patch so it still applies cleanly. Here's the little ritual, step by step:
- First, make sure your local branch is up to date with whatever changed upstream:
svk pull //local/foo
- Next, update your patch so it'll apply cleanly against the newest version of the upstream repository:
svk patch --update Foo
- Finally, regenerate your patch so it also includes the other changes you've made on your local branch since you created it β or since you last regenerated it:
svk patch --regen Foo
Wanna get a list of every patch your svk knows about? Say less:
svk patch --list
Wanna see the current version of one specific patch? Easy:
svk patch --view Foo
When you're done with a patch and you don't want it just hanging around anymore like a ghost in your repo, run:
svk patch --delete Foo
And to apply a patch that someone else sent you, run:
svk patch --apply - < contributed_feature.patch
(notice the -? yeah, that's stdin doing its thing. feed it the file. chef's kiss. π₯)
okay that's the whole page, bestie, go forth and patch responsibly π«Ά
this one came from the User Contributed Perl Documentation, and it's running on perl v5.42.0, dated 2025-07-25, filed under SVK::Co...d::Patch(3). slay. πβ¨
π¦ where this page comes from
- fedora 43: perl-SVK 2.2.3-45.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms