BLD: make the way we count commits for version numbering more robust (#16709)
BLD: make the way we count commits for version numbering more robust (#16709)

I think this will fix the issue with commit count being zero reported
in gh-16702.
rgommers/scipy,andyfaff/scipy,andyfaff/scipy,anntzer/scipy,Stefan-Endres/scipy,perimosocordiae/scipy,endolith/scipy,WarrenWeckesser/scipy,Stefan-Endres/scipy,WarrenWeckesser/scipy,ilayn/scipy,WarrenWeckesser/scipy,mdhaber/scipy,mdhaber/scipy,perimosocordiae/scipy,endolith/scipy,endolith/scipy,rgommers/scipy,anntzer/scipy,ilayn/scipy,WarrenWeckesser/scipy,mdhaber/scipy,ilayn/scipy,perimosocordiae/scipy,mdhaber/scipy,scipy/scipy,perimosocordiae/scipy,scipy/scipy,Stefan-Endres/scipy,perimosocordiae/scipy,Stefan-Endres/scipy,scipy/scipy,anntzer/scipy,WarrenWeckesser/scipy,anntzer/scipy,mdhaber/scipy,rgommers/scipy,endolith/scipy,endolith/scipy,ilayn/scipy,scipy/scipy,Stefan-Endres/scipy,WarrenWeckesser/scipy,mdhaber/scipy,andyfaff/scipy,Stefan-Endres/scipy,ilayn/scipy,anntzer/scipy,endolith/scipy,scipy/scipy,scipy/scipy,rgommers/scipy,andyfaff/scipy,andyfaff/scipy,perimosocordiae/scipy,anntzer/scipy,rgommers/scipy,ilayn/scipy,andyfaff/scipy