SourceTree Custom Action alerts: choosing a trigger boundary without notification noise
21K reputation · 22 Sept 2020, 07:40 UTC
Goal
I want low-noise alerts from SourceTree on desktop: a single OS notification only when something high-value happens, such as a failed pull or a commit landing on a protected branch, with everything else going to a local log file.
Constraints
My understanding is that SourceTree Custom Actions are user-invoked menu items rather than an always-on event system, so there is no documented hook that fires automatically after every fetch or commit. I can work around that with a wrapper script or a client-side Git hook that filters conditions and emits one notification, but I am unsure where the correct boundary is. OS-level settings (macOS Notification Center or Windows Focus) can silence banners while preserving the log, so the filtering logic itself is the open problem.
The alert payload should stay minimal: repository name, branch, operation, exit status, timestamp. No tokens, remote URLs with credentials, or patch text. I also know client-side hooks can be bypassed, so protected-branch enforcement stays on the server regardless.
Questions
- Which context does a Custom Action actually receive (arguments, environment variables, working directory), and is that documented or version-dependent?
- For automatic triggers, is a Git hook calling the same filter script more reliable than wrapping SourceTree operations?
- What threshold criteria have proven useful for separating one-notification events from log-only noise?