My org has some silly requirements that you must put “admin” at the end of every SVN commit message in order to get around some decision made by the SVN gatekeepers that every commit should have an associated bug number. (Everyone on the team bypasses this requirement similarly.)
I’m trying to use git SVN, but I’d like to avoid putting “admin” at the end of my frequent git-svn commits.
Is there a way to have git SVN do this for me?
You can set up a git commit hook, so that when you commit to git, it will append
"admin"to the commit message. Then when you do yourgit svn dcommit, your commit messages will already have the expected string there.Documentation on git hooks.
In your project’s
.gitdirectory, there will be a directory calledhooks.You can take a look at the files,
prepare-commit-message.samplecan be used to edit commit messages before they are committed.Make a copy of
prepare-commit-message.sampleand call itprepare-commit-message.So open that file, and as a demonstration I added this line to the end:
Save changes, exit, try a change, and commit it.