BUG: forward port lint_diff shims (#13036)
BUG: forward port lint_diff shims (#13036)

* BUG: forward port lint_diff shims

* forward port the Travis CI shallow clone-related
fixes required for `lint_diff.py` to run properly
on backport PRs from gh-13028

* a better fix might happen with the Python module
itself so that the module may be used within any
CI service (or at least provide some kind of warning
in the presence of a shallow clone); that said,
if such a fix is pursued, please do test with a "dummy
PR" against a maintenance branch as well

* MAINT: PR 13036 revisions

* reduce the amount of data fetched in Travis CI for the purposes
of the `lint_diff.py` script in backport PRs, as requested by
reviewer
rgommers/scipy,zerothi/scipy,Eric89GXL/scipy,matthew-brett/scipy,tylerjereddy/scipy,scipy/scipy,perimosocordiae/scipy,anntzer/scipy,perimosocordiae/scipy,Eric89GXL/scipy,anntzer/scipy,e-q/scipy,vigna/scipy,Stefan-Endres/scipy,WarrenWeckesser/scipy,endolith/scipy,mdhaber/scipy,grlee77/scipy,matthew-brett/scipy,WarrenWeckesser/scipy,Eric89GXL/scipy,grlee77/scipy,ilayn/scipy,ilayn/scipy,ilayn/scipy,rgommers/scipy,zerothi/scipy,andyfaff/scipy,vigna/scipy,anntzer/scipy,Eric89GXL/scipy,e-q/scipy,WarrenWeckesser/scipy,e-q/scipy,ilayn/scipy,grlee77/scipy,Eric89GXL/scipy,andyfaff/scipy,scipy/scipy,scipy/scipy,andyfaff/scipy,anntzer/scipy,zerothi/scipy,zerothi/scipy,endolith/scipy,mdhaber/scipy,Stefan-Endres/scipy,mdhaber/scipy,e-q/scipy,scipy/scipy,endolith/scipy,anntzer/scipy,endolith/scipy,tylerjereddy/scipy,perimosocordiae/scipy,matthew-brett/scipy,vigna/scipy,matthew-brett/scipy,Stefan-Endres/scipy,andyfaff/scipy,ilayn/scipy,rgommers/scipy,endolith/scipy,grlee77/scipy,andyfaff/scipy,Stefan-Endres/scipy,anntzer/scipy,perimosocordiae/scipy,WarrenWeckesser/scipy,mdhaber/scipy,zerothi/scipy,zerothi/scipy,rgommers/scipy,rgommers/scipy,ilayn/scipy,mdhaber/scipy,endolith/scipy,tylerjereddy/scipy,andyfaff/scipy,Stefan-Endres/scipy,scipy/scipy,tylerjereddy/scipy,perimosocordiae/scipy,Stefan-Endres/scipy,e-q/scipy,WarrenWeckesser/scipy,scipy/scipy,mdhaber/scipy,tylerjereddy/scipy,vigna/scipy,matthew-brett/scipy,Eric89GXL/scipy,perimosocordiae/scipy,WarrenWeckesser/scipy,grlee77/scipy,vigna/scipy