git log takes (among other things):
-n numto limit the number of commits shown: choose 1 (and ifnumis 9 or less you can just write-num, hence,-1, for short)--pretty=format:string with directivesto change the log output format. The%sdirective gets the commit “subject”, which is what you also get withoneline.
Hence: git log -n 1 --pretty=format:%s $hash (or git log -1 --pretty=format:%s) will do the trick here.
For a complete list of format directives, see the git log documentation, under “PRETTY FORMATS” (about halfway down).