Repository navigation
feat: amend staged changes into an older commit (DAN-92) - #154
Merged
Merged
Conversation
This was referenced Oct 19, 2026
Fold staged changes into a chosen graph commit as one operation: create a fixup, then replay an oid-built rebase plan with autostash. Refuse ranges that contain a merge, warn when the target is already on upstream, and restore the pre-fixup tip if the rewrite is aborted. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
- The amend marker now records the pre-amend tip and the fixup commit. Abort restores the original only for a rebase abort that lands exactly on that fixup; any other abort just drops the marker. - A finished amend-into rewrite (direct or via Continue) whose autostash re-apply conflicted now returns an error naming the stash instead of reporting success. git exits 0 in that case. - Tests: merge commit as the target is refused, a stale marker is ignored by an unrelated cherry-pick abort, a conflicting autostash after Continue is surfaced. Co-authored-by: Daniels <danielss-dev@users.noreply.github.com>
danielss-dev
marked this pull request as ready for review
October 19, 2026 14:58
danielss-dev
force-pushed
the
developements/amend-into-commit-a04a
branch
from
October 19, 2026 14:58
3e8f9d7 to
4294df2
Compare
danielss-dev
added a commit
that referenced
this pull request
Oct 19, 2026
danielss-dev
added a commit
that referenced
this pull request
Oct 19, 2026
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.
Summary
First slice of DAN-92: Amend staged changes into this commit on a graph commit, as one operation.
fixup!commit, then replays an explicit oid plan (pickeach commit in the range,fixupthe new oid immediately after the target). Does not use--autosquash, so two commits that share a subject stay distinct.@{upstream}(a force push will be needed)..git/strand-amend-into). Continue uses the existing sequencer.amend-into). Hunk and line moves are out of this slice and were not filed.Proof
cargo test -p strand-core --lib history::tests::amend_into -- --nocapture— 7 passed, 0 failed.a.txt(touched in C1) plus an unstaged edit toc.txt. After the action, subjects stayc1,c2,c3; C1's blob isa\nplus; C2/C3 blobs are unchanged; the worktree still hasc\nlocal; the index forc.txtis stillc; nofixup!remains. Rewritten oids:414d34e9…,b88d1ad5…,901dd48d….same. The chosen oid's diff contains+plus; the later same-subject commit's diff for that file is empty.--rootrebase; file becomesa\nplus; subjects stayroot,c2.fee6453d…), putsstagedback in the index, keeps unstagedg\nlocal, and leaves nofixup!commit.staged; subjects stayc1,c2,c3; unstagedg.txtis preserved; the marker is gone.feature,main,Merge branch 'feature',afterand setshas_merge. The operation errors withthis range contains a merge commit — Strand won't rewrite it. HEAD and the staged diff are unchanged.@{upstream}→pushed=true. A newer local-only commit →pushed=false. HEAD andorigin/mainstay put.Local gates before push:
cargo testfor the CI packages,cargo clippy -p strand-core -p strand-tauri -p strand-ops -p strand-headless -p strand-azdo-protocol -p strand-azdo -- -D warnings,pnpm --filter ./ui test(105 files, 626 tests), andpnpm --filter ./ui exec tsc --noEmitall exited 0.CI
Native agent review (Windows) failed twice in
pull_requests::pages::tests::cancellation_terminates_an_active_readbefore the WebView2 step: PowerShell did not create the ready file within 10s (child did not reach its cancellation checkpoint). That startup budget is now 30s. The cancel-latency check is still under 5s.Test plan
Review fixes
git ls-files --unmerged), names the stash, and returns an error instead of a silent success. The direct path does the same.ci:commits stay, because removing them would need a force push.Merge order 157 → 153 → 155 → 154 → 156 → 158: this PR must adapt to #155 (new
rebase/interactive_rebasesignatures, and passingupdate_refs). #156 must wrapamend_intoin its journal.