msvn stands for my svn and is an svn wrapper to ease using svn in a terminal.
Contrarily to git, svn is not so console-friendly out of the box: for example, output is not paginated or colored, it just goes straight out to the terminal.
This wrapper tries to fix this and adds a bunch of quality of life commands on top of it.
Since it was initially used on a windows machine, it can also be sourced by a
windows bash (eg. cygwin, git-bash, MSYS64, ...) and its main function,
mysvn, aliased to svn.
Windows is slow at starting new processes but in this way invoking msvn gets
somewhat faster.
Listed from more basic to more complex:
- pipe output of many commands to
less -F, like on git - include line numbers in
blameoutput (and use a pager, duh) - new command
bat: likesvn catbut with syntax highlighting - colored
diffoutput - new command
dst|dstat: diff with stats similar togit diff --stat - new command
ddi|ddiff: wordwise diff with syntax-highlighting - new command
sddi: same asddibut side-by-side - new command
slog(short-log): output similar togit log --onelineusingshort-log - repo path expansion: if path starts with "
/" msvn will try to figure out the true root of the repo within remote. Useful if the same server is used to host multiple repos and you can't use the already present "^" svn shortcut.
Example: if current checked out dir is^/nucular-launch-codes/branches/Marioand you callmsvn diff /branches/Luigiit will get converted tosvn diff ^/nucular-launch-codes/branches/Luigi - new command
sr(set root): output command to set the$srshell variable to the true root of the repo.
Use alternatively to the/path expansion of the previous point by runningeval $(msvn sr)and then the cmd that relies on$sr(ex.msvn di "$sr/branches/Mario") - improved bash completion script with support for changelists.
Use it by running
eval "$(msvn completions)"in your~/.bashrcfile or similar - support for pre-commit hooks similarly to git: place a
pre-commitexecutable in.svn/hooks/in your repo. It will be invoked in the current working directory with all arguments followingsvn commitasargv. If the program returns with an error the commit is aborted.
An examplepre-commitfile is provided
- Clone the repo to
~/src/msvnor another dir. (A couple commands -completions,slog- rely on the repo being checked out there: If you use another dir, edit the script to point to the real dir) - Add the
msvnscript toPATH. - (optional) alias
msvntosvnin your shell