Partly as an exercise, partly because it almost works and I feel the need to finish it...
I can git clone $repo --branch $ref --single-branch --depth 1
and it works great for tags and heads.
I can git pull --depth 1 $repo $sha
and it works great, as long as $sha is a FULL value. BUT: this fails if that is abbreviated, even by 1 character.
Is there any way achieve this? I am trying to automate git synchronization and very large repos are a problem. Using depth 1 helps a ton, but I can't figure how to use an abbreviated SHA.