Page MenuHomePhabricator

Failure when trying to force push
Closed, ResolvedPublic

Description

$ git push --force --all
Counting objects: 30151, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (29312/29312), done.
Writing objects: 100% (30151/30151), 371.97 MiB | 1.04 MiB/s, done.
Total 30151 (delta 11881), reused 0 (delta 0)
remote: [2013-12-11 07:06:30] EXCEPTION: (CommandException) Command failed with
error #1!
remote: COMMAND
remote: git merge-base '27665b1043bb031b1c3fa4547260159c4a6f705f' 'f352ee59e78c7
8ac50c05c1043f756608cad8d7e'
remote:
remote: STDOUT
remote: (empty)
remote:
remote: STDERR
remote: (empty) at [/srv/phabricator/libphutil/src/future/exec/ExecFuture.php:34
9]
remote:   #0 ExecFuture::resolvex() called at [/srv/phabricator/phabricator/src/
applications/diffusion/engine/DiffusionCommitHookEngine.php:259]
remote:   #1 DiffusionCommitHookEngine::findGitMergeBases(Array of size 4 starti
ng with: { 0 => Array of size 7 starting with: { old => a43ee4455186df2afff6f8e7
3e83a9aa9706107b } }) called at [/srv/phabricator/phabricator/src/applications/d
iffusion/engine/DiffusionCommitHookEngine.php:220]
remote:   #2 DiffusionCommitHookEngine::parseGitUpdates(a43ee4455186df2afff6f8e7
3e83a9aa9706107b 72b95e23b797f0b26c316339ce7df4c6d1f1500f refs/heads/beta
remote: 22bc4ed1dedf8e3f3e7b07d56ceb1335490e4283 2feb0a99a661ea46f795248db0e70e6
0c3b203e8 refs/heads/live
remote: 27665b1043bb031b1c3fa4547260159c4a6f705f f352ee59e78c78ac50c05c1043f7566
08cad8d7e refs/heads/master
remote: 1abbdb07fc31ce10d71f792e640f6dcca34bfc85 f9a7352e6ff1ee81c014eaa6c8cca07
994f9106f refs/heads/uat
remote: ) called at [/srv/phabricator/phabricator/src/applications/diffusion/eng
ine/DiffusionCommitHookEngine.php:126]
remote:   #3 DiffusionCommitHookEngine::executeGitHook() called at [/srv/phabric
ator/phabricator/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
:95]
remote:   #4 DiffusionCommitHookEngine::execute() called at [/srv/phabricator/ph
abricator/scripts/repository/commit_hook.php:101]
To ssh://git@...../diffusion/P/
 ! [remote rejected] beta -> beta (pre-receive hook declined)
 ! [remote rejected] live -> live (pre-receive hook declined)
 ! [remote rejected] master -> master (pre-receive hook declined)
 ! [remote rejected] uat -> uat (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@...../diffusion/P/
'

Event Timeline

waynea assigned this task to epriestley.
waynea raised the priority of this task from to Needs Triage.
waynea updated the task description. (Show Details)
waynea added a project: Diffusion.
waynea added subscribers: waynea, hach-que.

Ah, thanks. I think what's happening here is that we use git merge-base to figure out which refs are new, but when the old and new refs share no ancestors the behavior seems to be "exit with an error and without output".

It would be nice to find a positive test for this case, so we can be certain the error was caused by the lack of shared ancestry. It looks like git merge-base --is-ancestor ... is also a negative test (i.e., exits with an error to indicate no ancestry). We could "git log --reverse" both commits and take the first line of output, but that's pretty messy.

I'll fix this for now and we can try to find a cleaner approach later.

If we run into too much more of this we can add a web UI option to disable all of the the hook behaviors temporarily to provide a general workaround, but this feels pretty edge-casey.

epriestley triaged this task as Normal priority.Dec 11 2013, 2:28 PM

This should be fixed in HEAD, let us know if you still see issues or run into anything else. Thanks for the report!