When needing to utilize the range option for "git rev-list" you will need to use the full SHA-1 for each of the revisions.
As an example if you wanted to compare your current build you are pushing to CircleCI to main:
mainbranchsha=$(git rev-parse origin/main)
git rev-list --count $mainbranchsha..$CIRCLE_SHA1
Article is closed for comments.