On Mon, 30 May 2005, Dave Jones wrote:
GIT_AUTHOR_NAME="John Doe" \
GIT_AUTHOR_EMAIL="jdoe@foo.com" \
git-commit-tree `git-write-tree` \
-p $(cat .git/HEAD ) \
< changelog.txt \
> .git/HEAD
You _really_ want to script this.
Also, I'd seriously suggest you avoid using ".git/HEAD" _and_ writing to
.git/HEAD in the same command. Maybe it works, maybe it doesn't.
So script it with something like
#!/bin/sh
export GIT_AUTHOR_NAME="$1"
export GIT_AUTHOR_EMAIL="$2"
tree=$(git-write-tree) || exit 1
commit=$(git-commit-tree $tree -p HEAD) || exit 1
echo $commit > .git/HEAD
and now you can just do
commit-as "John Doe" "jdoe@foo.com" < changelog.txt
or something like that.
The git commands really are designed to be scripted.
Linus