fix(deploy): say what a diverged branch means, and how to fix it - #19
Merged
Conversation
A force-push on main left the server's checkout on the old SHAs, so the deploy failed with git's diverging-branches advice and the word "aborting" — which reads as a broken script rather than as a checkout one command away from fine. `git pull --ff-only` stays. A deploy must never merge or rebase on its own, and nothing here resets the checkout automatically: that would silently discard a commit someone made on the server, which is the thing the cleanliness check two steps earlier exists to prevent. The script now recognises the case, prints both SHAs and the exact recovery command, and stops. Third cryptic deploy failure in a row, so it comes with a test.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
build-olddeadlock (#17) is cleared — the cleanliness check passes now. The next deploy failed one step later, on the pull:Caused by a force-push on
main: the server's checkout sat on the pre-rewrite SHAs, so--ff-onlycorrectly refused. But the output is a wall of git advice ending in "aborting", which reads as a broken script rather than as a checkout one command away from fine.What changed
git pull --ff-onlystays. A deploy must never merge or rebase on its own, and nothing here resets the checkout automatically — that would silently discard a commit someone made on the server, which is exactly what the cleanliness check two steps earlier exists to prevent.The script now recognises the case before the pull and says so:
Test
Third cryptic deploy failure in a row, so it comes with a guard: the check exists, it names the recovery, and it sits before the pull.
That last assertion is compared on the executable lines with comments stripped — the comment above the check also says
git pull --ff-only, and matching that instead reported the guard as coming after the pull it precedes by twelve lines.