Introduce git_reference_shorthand

Generate a shorthand name out of the full refname.

---

I'm sure the name can be made better, maybe `_short_name`?

Current git's representation of remote-tracking branches is currently split between the old way of including `remotes/` which `gitk` and `name-rev` show, and `branch` and `log` not including it. I went with the latter as it's the newer one and how one talks about remote-tracking branches anyway.