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 your git svn dcommit
, your commit messages will already have the expected string there.
Documentation on git hooks.
In your project's .git
directory, there will be a directory called hooks
.
cwd: ~/testrepo/.git/hooks master
λ > ls
applypatch-msg.sample post-update.sample pre-commit.sample prepare-commit-msg.sample
commit-msg.sample pre-applypatch.sample pre-rebase.sample update.sample
You can take a look at the files, prepare-commit-message.sample
can be used to edit commit messages before they are committed.
Make a copy of prepare-commit-message.sample
and call it prepare-commit-message
.
cp prepare-commit-message.sample prepare-commit-message
So open that file, and as a demonstration I added this line to the end:
# Append 'admin' to the end of the commit message, $1 is the message passed as argument
echo "admin" >> "$1"
Save changes, exit, try a change, and commit it.
λ > echo etc >> README
λ > git add .
λ > git commit -m "testing"
[master 89a435d] testing admin
1 files changed, 1 insertions(+), 0 deletions(-)
λ > git log
commit 89a435d5e110229d3c9989bfb464ae2420eb5088
Author: birryree
Date: Fri Oct 28 12:54:20 2011 -0400
testing
admin