I have a job set up to build when a change is pushed to Bitbucket. The first time the job runs, it'll get kicked off by a new push. The log will then state that it's seen X number of branches in the repo, and schedule further runs of the job to build on all the newly discovered branches, no matter how old they are. This means a new set of unit tests might have to run on 500 branches before it's caught up, even if those branches are very old and we know they'll fail before they even start.

Is there any way to prevent this "lookback" behavior? I don't want all the extra builds scheduled, I'd like the job to just run for new pushes going forward, ignoring old branches until a push is made to them.

Sidenote: Yes I know we have too many old branches; not my call, nothing I can do about it. Also I know I can turn off Bitbucket notifying so the job doesn't report back, but it's still ultimately a waste of resources.

Browse other questions tagged or ask your own question.