Add option to skip diverged branches that could not be force pushed to but force push the rest during push mirroring
Summary
By default, if even one branch-to-be-mirrored has diverged, the entire mirroring is broken. keep_divergent_refs
options was introduced to mitigate this.
But, when Keep divergent refs
option is turned on, unprotected branches are no longer force pushed from source repo to the target repo by push mirroring. This means, with that option turned on if I force push to an unprotected branch in a source repo, it no longer gets mirrored to the target repo. Push mirroring is supposed to force push any unprotected branch from source to target. Keep divergent ref was introduced just to skip the ones where this force push was attempted and failed (which happens if protected branches diverged) without failing the whole mirroring, but it seems it no longer attempts to force push unprotected branches too.
What is the current bug behavior?
Force push is all-or-nothing. There is no option to "Attempt to force push everything. If something fails, skip them but continue with the rest instead of failing the entire mirroring".
What is the expected correct behavior?
An option to skip failed-to-be-force-pushed branches.
Proposal
- By default, attempt to force push everything but fail the entire mirroring if any of those force pushes fail (current default)
- Add an option to skip refs where force pushes fail, but continue with rest of the force pushes (do not fail entire mirroring, just show visual indication that some refs failed to push)
-
keep_divergent_refs
won't attempt to force push anything, being true to its name (current situation). It just attempts regular pushes. And if something fails, it moves on to the next ref, without failing the entire mirroring.