Straight detaches head on initial install when using a version-controlled lockfile, throwing errors in freeze/thaw
Edit: possibly related to #375 and its assorted posts.
Emacs version: GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.27, cairo version 1.17.4) of 2021-03-26 Operating System: Arch Linux, Linux 5.10.64-1-lts x86_64 git version: 2.33.1
Overview:
The straight.el README recommends saving your lockfiles in version control, and also says that during a fresh install of Emacs on a new machine, said lockfile should be in ~/.emacs.d/straight/versions/ so the correct revisions are checked out on the first install. However, I've been having trouble with the straight repo specifically on initial installs when I'm on the "develop" branch, or if the revision of straight in my lockfile doesn't match where master's at.
In the former case, if I have ("straight.el" . "c16b57...") as an entry in my lockfile and straight-repository-branch set to "develop", upon cloning my configuration to a new machine and starting Emacs, all of the package are cloned and loaded correctly. However, if I then try to freeze or thaw my versions, I get a "Failed to get unambiguous name for 'develop'" error. If I then go to the cloned straight.el repo and do git status, I can see that HEAD is at the commit specified in my lockfile, but there's no "develop" branch - the head is detached. This causes problems with at least the freeze and thaw commands, but possibly others I haven't found.
This also seems to happen if I have a commit on straight's master branch in my lockfile that's behind the current tip of master - I'll get a "detached HEAD is behind default branch 'master'" error, which is a little easier resolved by checking out master and then running straight-thaw-versions again, which normalizes everything.
Not sure if this is a bug, or if I'm misinterpreting the intended way to set up reproducible version-controlled builds with straight.
Steps to reproduce:
cd ~
git clone https://github.com/erganemic/minimal-config.git .emacs.d
emacs
Then, after the setup has finished, try e.g. M-x straight-freeze-versions. You should get a "Failed to get unambiguous name for 'develop'" error for straight.el.
If you go into the repo for straight.el and do git status, you should see that the head is detached.
I am also seeing this right now, under the exact same conditions. Changing the straight branch back to master seems to work around this. But not really a solution, of course.