Skip to content

fix(tui): show error message to user if not everything was committed#13011

Merged
davidpdrsn merged 1 commit intomasterfrom
dp/omzwmnosuoty
Mar 24, 2026
Merged

fix(tui): show error message to user if not everything was committed#13011
davidpdrsn merged 1 commit intomasterfrom
dp/omzwmnosuoty

Conversation

@davidpdrsn
Copy link
Contributor

If for some reason some hunks were rejected by but_api::commit::create::commit_create we now tell the user. Previously they just silently wouldn't be committed.

I have mostly been experiencing this because I tried to commit something to one stack would have resulted in conflicts in another. That causes a rejection. The bare minimum is to tell the user that something went wrong, which is what this PR does. It still isn't a great UX but we don't really have the APIs to improve it yet.

My opinion is that we should tell the user that there will be conflicts, before committing, but still allow making the commit. We should then also provide good tools to fix the conflicts, either before making the commit or after. That requires things like dry-runs which we are working towards.

There are also other ways to commit such as rubbing. I'll deal with those separately.

Copilot AI review requested due to automatic review settings March 24, 2026 13:51
@vercel
Copy link

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Ignored Ignored Mar 24, 2026 2:09pm

Request Review

@github-actions github-actions bot added rust Pull requests that update Rust code CLI The command-line program `but` labels Mar 24, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the legacy status TUI commit flow by surfacing partial-commit failures to the user when but_api::commit::create::commit_create rejects one or more diff specs, instead of silently dropping them.

Changes:

  • Map RejectionReason values to human-readable explanations and build a multi-line error message listing rejected paths.
  • Emit a Message::ShowToast error toast after commit creation when rejected_specs is non-empty.
  • Simplify the Message::ShowToast enum variant formatting (and remove the prior dead-code suppression).

@davidpdrsn davidpdrsn enabled auto-merge March 24, 2026 14:09
@davidpdrsn davidpdrsn merged commit 094a433 into master Mar 24, 2026
37 checks passed
@davidpdrsn davidpdrsn deleted the dp/omzwmnosuoty branch March 24, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI The command-line program `but` rust Pull requests that update Rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants