How to debug validatePush function in git integration
![]()
I am trying to use the Git integration tool RTC-GIT-Hooks-5.0. I have an Apache webserver that I can push and pull git requests from. I have a WebSphere RTC server with a Git project in it. But when I call validatePush in ValidatePush.py I get this error:
remote: userId = testuser
remote: 255a446694a048d78de383bd2698a2635f63ab70
remote: e5489f2a5ef172138bd123775d713100cae8653c
remote: refs/heads/master
To http://10.149.121.105/git/my_project.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'http://10.149.121.105/git/my_project.git'
The RTC project is setup for Git and I have a Authorized Git Requests. Prior to authorizing I was getting a different error ("User not authorized"). I've added some debug to the ValidatePush.py:
logToFile("userId = " + userId)
logToFile(localSha1)
logToFile(remoteSha1)
logToFile(remoteRef)
logToFile(excludeRefs)
validatePush(jazzRepoUrl, gitRepoKey, userId, localSha1, remoteSha1, remoteRef, excludeRefs)
logToFile("Done validating")
From the debugging I can tell that execution stops at/in the validatePush function which comes from rtcprocess.pyc:
from rtcprocess import validatePush
My question is, how can I debug what is happening inside this function? How can I know why the validate fails?
|
Accepted answer
One other answer
![]()
according to searches on the net
you have a pre-receive hook enable on the git repo server side (pre-receive hook declined)
I'd bet that you are trying a non-fast-forward push and the hook blocks it. If that's the case, simply run
git pull --rebase
before pushing to rebase your local changes on the newest codebase.
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.