title: How does `git log --all --graph` get the branch pattern
body: <p><code>git log --all --graph</code> shows my commits and draws a branch graph besides them.</p>
  
  <p>But if I look at the raw information outputted by the <code>git log</code> command, the branch name is only available for the last commit in each branch (the branch tip).</p>
  
  <p>Branches I've merged and deleted in the past don't even show up as names (they have no active tip), but still the graph renders them correctly.</p>
  
  <p>How does git retrieve this information and how can I get the same information by parsing the output of some git command? (That is: Which git command produces the needed information?)</p>