-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File hook plugin prevents new local branches to be pushed to the remote #27
Comments
Can you please share the configuration of the hook and also the relevant parts of the Bitbucket log file. Does the new commit contain changes which match the hook configuration or have you just created a new branch but without actual changes, but where a previous commit would match the configuration? In the latter case this might be than the same as #1. |
File Hook Plugin version 3.0 The error is seen:
Created a new repository, added a new file and pushed the changes.
In my local workspace: Test 1: Commit changes does not match the hook configuration
git push --set-upstream origin feature/syee_no_match Logs attached no_match_log.txt Test 2: Commit changes matches the hook configuration
Logs attached yes_match_log.txt |
Thanks for sharing the detailed information. I was trying to reproduce this but without luck. Can you try with a different/new repository as well to see if it happens there as well? |
I created a new repository and was able to reproduce the issue when pushing a new branch with commits to the upstream. Test Details Bitbucket Server v5.1.0 Test 1: Commit changes on new branch matches the hook configuration
Log file match_log.txt Test 2: Commit changes on new branch does not match the hook configuration
Log file nomatch_log.txt Thanks! |
This problem didn't exist in Bitbucket Server 4.14.1 so there may have been a change in the API, although I don't see anything relevant in their documentation. I have opened a PR with a potential fix. |
Also worth mentioning, the 4.14.1 server I tried it on has Git 2.9.3 and the 5.1.0 has 2.9.4. I don't see anything obvious in the 2.9.4 release notes though. |
Hello,
The File Hooks Plugin version 3.0 is preventing new local branches to be pushed to the remote if the file name and/or file size hook are enabled:
git push -u origin feature/syee_local_branch_test
Total 0 (delta 0), reused 0 (delta 0)
remote: Communication breakdown with Bitbucket.
To ssh://dev-bitbucket/test/syee_test_repo_3.git
! [remote rejected] feature/syee_local_branch_test -> feature/syee_local_branch_test (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@dev-bitbucket/test/syee_test_repo_3.git'
If the File Name and File Size Hooks are disabled, the push succeeds:
git push -u origin feature/syee_local_branch_test
Total 0 (delta 0), reused 0 (delta 0)
remote:
remote: Create pull request for feature/syee_local_branch_test:
<cut>
Sylvia
The text was updated successfully, but these errors were encountered: