I think a better way to go about this is to use the Heroku Platform API. Not sure if you're familiar with this, but Heroku maintains a list of every single release you've ever done, and you can pragmatically access this information (Git hash included), for whatever purposes you want.
If you'd like to see this from the command line, try this:
$ heroku releases
== postgression-api Releases
v173 Deploy 3f25d04 r@rdegges.com 2014/07/13 17:55:46
v172 Deploy 5bae169 r@rdegges.com 2014/07/13 17:49:02
v171 Deploy 0a71096 r@rdegges.com 2014/07/13 17:42:11
v170 Deploy a25b1b1 r@rdegges.com 2014/07/13 17:16:48
v169 Deploy 800b0a7 r@rdegges.com 2014/07/13 17:12:43
v168 Deploy 60dab8d r@rdegges.com 2014/07/13 17:07:48
v167 Add-on provider config update pgbackups 2014/04/19 04:36:32
v166 Deploy bfddd2f r@rdegges.com 2014/01/12 22:54:34
v165 Deploy 360c437 r@rdegges.com 2014/01/12 22:51:00
v164 Deploy daf2346 r@rdegges.com 2014/01/12 22:39:19
v163 Deploy b90f1d6 r@rdegges.com 2014/01/12 21:19:33
v162 Deploy 64ea061 r@rdegges.com 2014/01/12 20:32:29
v161 Deploy caa1298 r@rdegges.com 2014/01/12 20:28:01
v160 Deploy 85b7250 r@rdegges.com 2014/01/12 20:25:04
v159 Deploy a59a9d7 r@rdegges.com 2014/01/12 20:19:36
Here's a link to the specific API docs you need: https://devcenter.heroku.com/articles/platform-api-reference#release
Hope that helps!