#!/bin/bash -e

cat > msg << EOF



first line

EOF

# the following exports are just to make the size of the rev-list output only dependent on the size of the log message
export GIT_COMMITTER_NAME=Bar
export GIT_COMMITTER_EMAIL="bar@foo.com"
export GIT_COMMITTER_DATE="2000/01/01 00:00"
export GIT_AUTHOR_NAME=Foo
export GIT_AUTHOR_EMAIL="foo@bar.com"
export GIT_AUTHOR_DATE="2000/01/01 00:00"

git add msg
git commit -F msg --cleanup=verbatim
git rev-list --pretty=raw -1 HEAD | tee msg.tmp
SIZE=`cat msg.tmp | wc -c`
# current master gives a message length of 244
echo Expected message length: 259, got message length: $SIZE
git reset HEAD^ --hard

