Repository navigation
Land dependably: record where each copy stands, finish cut-short landings - #9
Conversation
…ings A copy now records three things, each answering one question: its base (what its files start from), the landing it was stacked on when made from another copy (the fork point), and its last landing (branch, commit, base it was made on, files). Landing builds on all three: - A landing's record is saved before the branch moves, so landing again after one cut short tells its own commit from someone else's, and finds an open pull request instead of opening a second one. - A branch with commits the copy didn't land is left alone (it would undo them); --force lands anyway. - A copy made from a landed copy follows that landing, not the branch's newest commit, so it never undoes what its parent landed later. - A copy put back as its base has it still lands, and `rm` counts the files it put back as unlanded. - Folder copies tell their bases apart by a counter instead of the clock, which collided on macOS CI. Carries over the idea of Sonny's #8 (save the record before publishing). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 82b2f4994a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…raft fingerprint() reads a path whose folder was replaced by a file or link as deleted, as land and rm need, instead of failing. Projects saved before keep their last landing with the pull request; reading them moves it to the copy, and the first land after takes the branch's commit as its own. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca4b92e81f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ding A copy with no changes lands whenever it landed before and its branch is there, with --force over others' commits too. A copy made from one whose landing came from older Graft, without its commit, isn't stacked on it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33948fe678
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A file the last landing carried that is no longer a change counts as lost only when it is back as it was in the commit the landing was made on: put back by hand. One a newer base changed again after merging it is not. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01CboUL9BU7nvDEZKfQBSkkq
This fixes issues 2 to 5 from the outside review of 7fad8fb. Issue 1, the merge-file exit code, was fixed separately in #7. The PR also settles the state model the review asked for first.
State model
A copy now records three things, and each one answers a single question:
base: what its files start from.gft syncmoves it. For a repository it is a commit. For a plain folder it isN@SECONDS: N comes from a counter kept per project and is the only part used to tell bases apart; the time is just for display.stacked: the fork point. When a copy is made--fromanother copy that had landed, this is that copy's landing (branch, commit, and the base it was made on), as it was at that moment.landed: the last landing. It holds the branch, the commit, the base it was made on, and the file fingerprints.A fourth field,
pending, is short-lived. It holds a landing whose commit exists but whose branch may not have moved yet.Prnow holds only the number and the URL.Fixes
landno longer undoes remote branch changes. If the branch on GitHub isn't at the commit this copy last landed,landrefuses and explains why. The same goes for a branch of that name the copy never landed, even when its files match.--forcelands anyway.landno longer undoes the parent's later landings. A child's first commit follows the parent's landing as it was when the child was made, not the parent branch's newest commit. Its PR is based on that branch.landrefuses.rmguard now also checks every file the landing carried against the copy as it is now. A file put back to its old content counts as unlanded. A file the base has caught up with does not, as after a merge and sync.folder_bases_taken_in_one_second_differfailing on macOS CI. The replacement unit test is deterministic.This carries over the core idea of Sonny's #8, which is to save the record before publishing, and applies it to every landing.
Tests
A new end-to-end test,
landings_cut_short_are_finished_and_never_undo_others_work. The fake GitHub can now cut a call short in four ways: fail a ref update, lose a ref update's answer, fail a PR creation, or lose a PR creation's answer. The test covers:rmrefusal, the landing of the revert, thenrm.cargo testpasses on Linux with FUSE, and clippy is clean.Generated by Claude Code