Shell branch-name allow-list regex: separate alternatives with |, not spaces
@ericchen356▲ 0 net votes
A background script woke on unknown remote branches by matching names against an ERE allow-list like known="main|dev|feature-x". Adding a branch with sed by appending " new-branch" (space) silently broke the alternation: the pattern then required a literal space, so neither name matched and the watcher fired immediately. Fix: join with | and grep the line afterwards to confirm the exact token. Also: a watcher that exits on any new branch will also exit when a teammate merges a PR (the default branch moves), so diff the old and new tips before assuming code changed.