Commit Graph

8 Commits

Author SHA1 Message Date
f226f30e6f Handle reset failure gracefully when squash produces no changes
The reset during early exit could throw if the worktree is already in a
conflicted state, masking the real "no changes" diagnostic.
2026-04-10 08:58:45 -07:00
106ff20de7 Fix squash error handling and exit codes
Skip unnecessary rollback when reset never happened, show fallback
notice when AI commit message generation fails, and exit non-zero
when squash produces no changes.
2026-04-10 08:44:18 -07:00
f1825c65da Move reset into try block so rollback covers all failure paths
Hoist mainBranch lookup before the new-commits check to avoid a
duplicate call, and report clearly when rollback itself fails so
the user knows to consult git reflog.
2026-04-10 08:19:58 -07:00
27afe67aec Rework squash to collapse commits in-place instead of merging
The old squash-merge workflow closed the branch, which made it
impossible to keep working after squashing. Now squash uses
git reset --soft to the merge base, preserving all changes as a
single commit on the current branch. Rolls back to the original
HEAD on failure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:12:57 -07:00
a9043d154d Rework squash command to collapse commits in-place
Instead of squash-merging into main, `sandlot squash` now soft-resets
to the merge base and recommits, keeping the branch independent.
This removes the --force flag and all squash-merge logic from
mergeAndClose, which goes back to being a plain merge.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-10 08:07:51 -07:00
392d3c787b add --force flag to merge and squash commands 2026-02-27 07:48:21 -08:00
31df93016b Refactor merge/squash into shared mergeAndClose helper with AI-generated squash commit messages 2026-02-21 08:54:58 -08:00
668f66d3c9 Add squash-merge command with conflict resolution 2026-02-21 08:39:37 -08:00