Skip to content

Stop throwing errors on post-commit hook#13774

Open
mtsgrd wants to merge 1 commit into
masterfrom
nitpicking-posthooks
Open

Stop throwing errors on post-commit hook#13774
mtsgrd wants to merge 1 commit into
masterfrom
nitpicking-posthooks

Conversation

@mtsgrd
Copy link
Copy Markdown
Contributor

@mtsgrd mtsgrd commented May 12, 2026

It would only lead to something daft like the preventing the commit
editor from closing automatically.

It would only lead to something daft like the preventing the commit
editor from closing automatically.
Copilot AI review requested due to automatic review settings May 12, 2026 15:33
Copy link
Copy Markdown
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

Adjusts the desktop app’s commit flows so post-commit hook failures don’t propagate as thrown errors, avoiding UI flows (like the commit editor closing) being blocked by hook execution outcomes.

Changes:

  • Changed runPostCommitHooks() to stop throwing on hook failure and to swallow exceptions.
  • Simplified post-commit hook invocation in commit drop handlers by removing now-unnecessary error branching.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/desktop/src/lib/git/hooksService.ts Makes post-commit hook execution non-throwing; logs errors instead of propagating.
apps/desktop/src/lib/dragging/dropHandlers/commitDropHandler.ts Removes special-case error handling around post-commit hooks since they no longer throw.

Comment on lines 56 to 59
} catch (e: unknown) {
chipToasts.removeChipToast(loadingToastId);
throw e;
console.error("Post-commit hook error:", e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants