Include ref log detail in commit, reset, etc.

When updating a ref at the direction of the user include a reason why
head was changed as part of the ref log (assuming it was enabled).

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
diff --git a/git-commit.sh b/git-commit.sh
index 6ef1a9d..a4b0a90 100755
--- a/git-commit.sh
+++ b/git-commit.sh
@@ -676,7 +676,8 @@
 		rm -f "$TMP_INDEX"
 	fi &&
 	commit=$(cat "$GIT_DIR"/COMMIT_MSG | git-commit-tree $tree $PARENTS) &&
-	git-update-ref HEAD $commit $current &&
+	rlogm=$(sed -e 1q "$GIT_DIR"/COMMIT_MSG) &&
+	git-update-ref -m "commit: $rlogm" HEAD $commit $current &&
 	rm -f -- "$GIT_DIR/MERGE_HEAD" &&
 	if test -f "$NEXT_INDEX"
 	then