Since I’m forever reinventing stuff that SVK already does, I thought I’d ask before coding up this idea:

A while ago, I got tired of reading through commit messages and not know in what directory or branch they occurred in. Trying to make things a bit easier, I started prefixing each commit message with the path the change is occurring in. For example, if I’m changing these files

trunk/lib/Foo/Bar/Baz.pm
trunk/lib/Foo/Bar.pm
trunk/lib/Foo/Qux.pm

I’d use trunk/lib/Foo/ as the path.

I’ve now gotten pretty tired of having to type this in for every commit, and I’m looking for a better way. Ideally, there would be a way of specifying — either per-user or system wide — that SVK should filter all commits through a given module. That module would be passed a list of all files involved in the commit, the draft commit message, etc., and it could then generate a new commit message. I would use this to have SVK figure out my little path scheme, saving my fingers from having to do that extra typing. Someone else who might benefit from making it easier to generate strictly-formatted commit messages: Subversion.

Why not do this on the repository side with a commit-hook, you ask? Easy: you can’t. Read the section in the SVN manual on hook scripts and scan for the big red warning about trying to use hook scripts to modify a transaction.

I’m pretty sure that SVK doesn’t already have a facility like this in place, but I’ve thought that before, as my pile of SVK gadgets will attest. So I’m asking this time.