A simpler solution is to use git ls-remote origin
:
git ls-remote --heads origin
For example, in the git repo:
C:\Users\vonc\prog\git\git>git ls-remote --heads origin|
117eea7eaaeb5ecb77d9b7cebdb40b4e85f37374 refs/heads/maint
f5b6079871904ba5b0a8548f91545f126caf898b refs/heads/master
edb03e5a9b9b63d0864557f99f339b2b5f3a9e4e refs/heads/next
014438bc5bdf9deef0d3888e58c9f76addc1106c refs/heads/pu
56f24e80f0af4dd3591c8f143183b59cf9a34620 refs/heads/tmp
33f854ca9eb8251f5b7fa1c670d4abcdd76764ce refs/heads/todo
That will list the most recent commits... even without fetching first!
That can be formatted and aliases easily:
C:\Users\vonc\prog\git\git>
git config alias.rh "!git ls-remote -h origin | while read b; do PAGER='' git log -n1 --color --pretty=format:'%ct%C(yellow)%d%Creset - %Cred%h%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%n' --abbrev-commit $( echo $b | cut -d' ' -f1 ) --; done | sort -rn -k1,10 | cut -c11-"
Then a simple git rh would give:
C:\Users\vonc\prog\git\git>git rh
(origin/master, origin/HEAD) - f5b6079 Second batch for 2.7 (3 months ago) <Junio C Hamano>
(origin/next, next) - edb03e5 Sync with 2.1-rc2 (1 year, 5 months ago) <Junio C Hamano>
(origin/tmp, tmp) - 56f24e8 completion: handle '!f() { ... }; f' and "!sh -c '...' -" aliases (1 year, 7 months ago) <Steffen Prohaska>
(origin/pu) - 014438b Merge branch 'nd/multiple-work-trees' into pu (1 year, 10 months ago) <Junio C Hamano>
(origin/todo) - 33f854c What's cooking (2013/07 #09) (2 years, 5 months ago) <Junio C Hamano>
(tag: v1.8.3.4, origin/maint) - 117eea7 Git 1.8.3.4 (2 years, 6 months ago) <Junio C Hamano>
That is:

This alias assume the remote is named 'origin' though.
To make it accept a parameter, it can be changed to a function:
C:\Users\vonc\prog\git\git>git config alias.rh "!f() { git ls-remote -h $1 | while read b; do PAGER='' git log -n1 --pretty=format:'%h%n' --abbrev-commit $( echo $b | cut -d' ' -f1 ) --; done; }; f"
^^
Then:
C:\Users\vonc\prog\git\git>git rh upstream
833e482
7548842
ef7b32d
f67e31e
e2281f4