Added: Atlassian Bitbucket v4.14.4
From my own repos setting page:
<SERVER>/users/christopher.hahn/repos/hooktest/settings/hooks
this is the text from the hook config web-dialog:
===============================
External Async Post Receive Hook
Executable: basictest.sh
Path to executable to run.
Safe mode [X] Look for hooks only in safe dir
Hooks will be searched only in <stash-home-dir>/external-hooks/
===============================
The script:
/var/atlassian/bitbucket-home/external-hooks/basictest.sh
is a classic, off the net:
===============================
#!/bin/bash
(
echo "Script name: $0"
echo "Positional arguments: ${@}"
echo "STASH_USER_NAME: $STASH_USER_NAME"
echo "STASH_USER_EMAIL: $STASH_USER_EMAIL"
echo "STASH_REPO_NAME: $STASH_REPO_NAME"
echo "STASH_IS_ADMIN: $STASH_IS_ADMIN"
while read from_ref to_ref ref_name; do
echo "Ref update:"
echo " Old value: $from_ref"
echo " New value: $to_ref"
echo " Ref name: $ref_name"
echo " Diff:"
git show $from_ref..$to_ref | sed 's/^/ /'
done
) | tee -a /tmp/external-hooks-test.log
===============================
The script is 755 and runs fine from the command line.
BUT, when I push any change, the console loops over the same output:
===============================
$ git push newbranch
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 285 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote:
remote: Create pull request for newbranch:
remote: https://XXXXX/users/christopher.hahn/repos/hooktest/compare/commits?sourceBranch=refs/heads/newbranch
remote:
remote:
remote: Create pull request for newbranch:
remote: https://XXXXX/users/christopher.hahn/repos/hooktest/compare/commits?sourceBranch=refs/heads/newbranch
remote:
remote:
remote: Create pull request for newbranch:
remote: https://XXXXX/users/christopher.hahn/repos/hooktest/compare/commits?sourceBranch=refs/heads/newbranch
<SNIP>
remote:
remote: Create pull request for newbranch:
remote: https://XXXXX/users/christopher.hahn/repos/hooktest/compare/commits?sourceBranch=refs/heads/newbranch
remote:
Killed by signal 2.
fatal: The remote end hung up unexpectedly
error: error in sideband demultiplexer
To ssh://git@XXXXX:7999/~christopher.hahn/hooktest.git
35734f5..8544dec newbranch -> newbranch
===============================
Has anyone else seen this?