SVK::Co...d::Patch(3)

πŸ“¦
version 2.2.3 Β· 2 versions
, in fedora 43

✨ 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:

  1. First, make sure your local branch is up to date with whatever changed upstream:
    svk pull //local/foo
  1. Next, update your patch so it'll apply cleanly against the newest version of the upstream repository:
    svk patch --update Foo
  1. 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