I found this answer already: Number of commits on branch in git but that assumes that the branch was created from master.
How can I count the number of commits along
It might require a relatively recent version of Git, but this works well for me:
git rev-list --count develop..HEAD
This gives me an exact count of commits in the current branch having its base on master.
The command in Peter's answer, git rev-list --count HEAD ^develop includes many more commits, 678 vs 97 on my current project.
My commit history is linear on this branch, so YMMV, but it gives me the exact answer I wanted, which is "How many commits have I added so far on this feature branch?".