YACC is implemented as a git pre-receive hook, which means it scans all commits when they're pushed to the repo. If a commit is already in the repository before YACC is turned on, merging that commit into a new branch does not trigger any checks.
We should add an option to find all the commits being merged in, and apply the check to all of them at merge time. This could also help with the fork workflow.
User interface details
We should instead have a “When to scan commits” dropdown with two options
“Only when initially pushed”
“When pushed or merged to a new branch”
The default setting for new repositories should be “When pushed or merged to a new branch”.
Repositories where YACC is already enables should keep the old behavior
I think if we just use RepositoryHookCommitFilter.ADDED_TO_ANY_REF instead of RepositoryHookCommitFilter.ADDED_TO_REPOSITORY we’ll get the desired result.
adds a scanMergedCommits hidden option which can be used to accomplish this – on this ticket we have to add a UI for it.
Examples of this request
(not exactly this ticket, but related request)