I'm trying to build a reliable "repo ahead and behind" signal for my bash prompt. Despite reading source code for many git prompts (shell, python scripts) and reading many stack overflow answers, I could not figure out why comparing
$ git rev-list HEAD..origin/master
did not actually compare master at the origin. Figured it out, so I decided to ask this question and answer it so it's not buried and will immediately answer someone else's similar question.