This repository was archived by the owner on Aug 30, 2026. It is now read-only.
Avoid unnecessary detached HEAD state in boot.sh and check out stable branch in migrate.sh - #240
Merged
Merged
Conversation
The checkout would be a no-op if already on `stable` (git would print `Already on 'stable'` but importantly would *not* return a failing exit code). It would fail if the user has local changes, but if they have local changes `git pull` would also fail, so there's no change there.
This is a follow-up to 1767107 - instead of checking out `FETCH_HEAD`, which always puts the user in 'detached HEAD' state, we will check out `${OMAKUB_REF:-stable}` so that we only end up in 'detached HEAD' state when necessary (i.e. when checking out a SHA rather than a branch).
rmacklin
commented
Aug 2, 2024
| @@ -1,5 +1,6 @@ | |||
| cd $OMAKUB_PATH | |||
| last_updated_at=$(git log -1 --format=%cd --date=unix) | |||
| git checkout stable | |||
Contributor
Author
There was a problem hiding this comment.
One thing I'm not sure about is whether omakub upgrade is supposed to be usable if you've originally installed master rather than stable. If so, this line might be undesirable.
Maybe it's better to drop this line, and just rely on the fixed boot.sh...
Collaborator
There was a problem hiding this comment.
Actually ,yes, on second thought I think you're right.
Contributor
Author
There was a problem hiding this comment.
Thanks! Apologies for not spotting the impact to the upgrade flow in the original PR. Probably warrants a mention in the release notes to instruct users to run cd $OMAKUB_PATH && git checkout stable if they encounter "You are not currently on a branch" errors when trying to upgrade.
burno-lima
pushed a commit
to burno-lima/omakdot
that referenced
this pull request
May 15, 2026
Avoid unnecessary detached HEAD state in `boot.sh` and check out `stable` branch in `migrate.sh`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up to #187 with the following changes:
Ensure the stable branch is checked out before pulling in
migrate.shThe checkout would be a no-op if already on
stable(git would printAlready on 'stable'but importantly would not return a failing exit code). It would fail if the user has local changes, but if they have local changesgit pullwould also fail, so there's no change there.Update
boot.shto avoid 'detached HEAD' state when not necessaryInstead of checking out
FETCH_HEAD, which always puts the user in 'detached HEAD' state, we will check out${OMAKUB_REF:-stable}so that we only end up in 'detached HEAD' state when necessary (i.e. when checking out a SHA rather than a branch).