title: Get pretty git rev name
body: <p>So I know this question have been asked a <em>lot</em>, but I don't find any suitable answers. I'm looking to display the name of the current git rev in my prompt, but in a pretty way : if I'm on a branch, I want the name of the branch; if it's not a branch, I'd like the relative name (ie <code>master~2</code>) in my prompt.</p>
  
  <p>At first, I was using something like <a href="https://github.com/Katen/dotfiles/blob/fdc226612f200cc4a5918fbd21c8249c0de6ca00/zshrc.d/available/prompt" rel="nofollow">what you can see here</a>. It worked well : I had the name of the branch, or the rev SHA1 number. Then I moved to an approached based on <code>git name-rev</code>, which was great at first, but then I noticed that the name was mixed up sometimes : after merging <code>master</code> into staging, on both branches I had <code>master</code> in my prompt. Given how much I rely on this, I can't have this. But having <code>master~2</code> instead of a SHA1 number was really great.</p>
  
  <p>So I hope there's a way to combine both approaches. If it's possible to display the tag name too, I'll take it (though I don't use them much - <em>yet</em>). And the top would be to have git only commands, no looking up git internal files -- they could change at some point.</p>
  
  <p>Thanks for reading!</p>