Repository navigation
Put the translation commit on top when the branch moved during the run - #121
Merged
Merged
Conversation
- A push rejected because the branch moved now fetches the branch and replays our single commit onto the new tip, then pushes again, when the branch only moved forward and the newer commits left our files alone (localheroai/localhero-ai#866). The signed-commit path already did this - A rewritten branch, an overlapping file or anything uncertain skips with the existing branch-changed notice instead of failing or overwriting - Failed pushes are classified from git's output: a permission failure fails at once, other failures keep the bounded retry - The contents: write hint only appears for permission failures - Real-git tests cover replay, overlap, renames, a rewritten branch and the unstaged localhero.json translate leaves behind
Merged
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.
Fixes the CLI half of localheroai/localhero-ai#866. Plan:
dev-docs/specs/866-git-push-branch-moved.md(reviewed by Codex twice before implementation).The bug
On newsroom-demo, two matrix jobs (one per app) committed to the same PR branch. The second
git pushwas rejected because the branch had moved, andpushWithRetryre-sent the same commit three times, then failed with "Check that the workflow grantspermissions: contents: write", which was not the problem. That app's translations were lost. The same happens in any repo when a developer pushes while a run commits. The signed-commit path already handled this (#90); the plain git path did not.The change
2>&1, printed with the token masked):fetch first,non-fast-forward,cannot lock ref,stale info) →rebaseOntoMovedBranchPermission to … denied, 403,could not read Username) →PushPermissionErrorat once, never a skiprebaseOntoMovedBranch, the plain-git counterpart offindTipSafeToCommitOn:--no-renames; any overlap →skipped-overlaprebase --autostash --onto FETCH_HEAD HEAD~1(replays only our commit;translateleaveslocalhero.jsonunstaged) and push again, at most twicecontents: writehint only for permission failures (PushPermissionError, or a signed commit refused withFORBIDDEN/403). Other failures show git's output with no invented hint.No force push, pull, reset or merge on our side; the tests assert that.
Verified
localhero.json, overlap, rename, force-pushed branch, fetch failure.autoCommitChanges/autoCommitSyncChanges, including permission-denied-while-moved and the amend path.localhero.json, the signed-commit hint) are fixed with tests.Before release
RC on newsroom-demo with parallel matrix jobs (drop
max-parallel: 1, keepcancel-in-progress: false): both apps' keys translated, one job shows "replayed the translation commit onto …". Plus a single-project regression run on demo-rails.README guidance: localheroai/localhero-action#8 (draft until this ships).