On the plugin's description, this is stated: "Branch friendly! Only new commits are checked. Commits that already exist in the repository will be skipped."
However, I cannot create and push a new branch from a tag if the tag has commits in its history that are not considered valid.
Here is what I do:
git checkout -b newBranch tag-with-invalid-commits.
git push -u origin newBranch
*Expected result:* the push succeeds, since I am not pushing any new commits, I'm just trying to push a branch ref to the remote.
*Actual result:* the push is rejected, because the plugin compares the old commits with my current name and email, which will fail for two obvious reasons:
there are commits committed by others
there are commits that did not follow the conventions.
The workaround I use now is to create the branch by using the BitBucket UI. However, I am certain that this should work using git commands too.
Another interesting fact is that after I successfully created a branch from a tag using the UI, I can create and push branches from the same tag without any issues.
Please investigate this.
Thank You in advance.
Update: it seems that the problem arises if the tag is not reachable from any branch. Based on this assumption, here are a few detailed replication steps:
1. Create a new branch: `git checkout -b newBranch`
2. Turn off commit checker.
3. Create commits that would violate the rules (wrong committer name, etc.)
4. Push the commits to the remote: `git push -u origin newBranch`
5. Create a tag: `git tag -a newTag -m "newTag"`
6. Push the tag: `git push --tags`
7. Checkout any other branch: `git checkout master`
8. Remove the local branch: `git branch -D newBranch`
9. Remove the branch from the remote: `git push origin :refs/heads/newBranch`
10. Turn on the commit checker.
After these steps, there are invalid commits reachable from `newTag`, but not reachable from any branches, and the initial replication steps should show the problem:
git checkout -b brandNewBranch newTag
git push -u origin brandNewBranch
The push should fail because of the commits that already exist on the remote.