When I run M-x straight-freeze-versions, for example, I get a "Git failed" error if one of my repos is a shallow clone. The VC commands need a complete overhaul at some point.
just a heads up for whoever takes this issue on, there are some nasty interactions lurking here. for example, in the org-mode repository, release_9.4 is a tag object with sha1 50fd89cb9379c8dc64552146116273c23bcc7331. that tag object points to a commit, fbccf09c740a298e39daa9170bceaa92684f2fe0. however, you can't actually fetch the commit object from the repo because it's an unadvertised ref (git fetch --depth=1 fbccf09c740a298e39daa9170bceaa92684f2fe0 will fail). so you have to use the tag's sha1 in your lockfile. but then when you freeze the lockfile, it'll get changed to the commit sha1 instead (since the actual HEAD commit is fbccf09, not 50fd89c). then if you commit that change to your lockfile and you try to clone from scratch, you'll get the unadvertised ref error because you're on the commit sha1 again. honestly i don't even know what the correct behavior would be here
The reason for this is because Org is not hosted on GitHub, so their repository settings are different. In particular GitHub allows fetching unadvertised refs, but Org doesn't. If you try your experiment again with the Org mirror (https://github.com/emacs-straight/org-mode) then you should find that you can fetch the commit ref fbccf09c740a298e39daa9170bceaa92684f2fe0 just fine.
What _should_ happen is straight.el will attempt to do a shallow clone, have it fail, and fall back to the full clone. (Does that happen?) I don't think there's anything better to do, other than report a bug to the Org repo maintainers to please allow us to fetch unadvertised refs.
Hacking around with tag refs is I think not a good path to start down. We should do it on the commit level, or not at all.
What should happen is straight.el will attempt to do a shallow clone, have it fail, and fall back to the full clone. (Does that happen?)
yep this fallback happens (with #616). but it is possible to have the shallow clone succeed, if you put 50fd89c in your lockfile. if you do that, then you get into the weirdness i described. i agree there's probably nothing better for straight.el to do in that situation