[jbosstools-issues] [JBoss JIRA] (JBIDE-12138) serveradapter is git forcing without asking when error occurs in normal git commit
Andre Dietisheim (JIRA)
jira-events at lists.jboss.org
Fri Jun 8 08:34:17 EDT 2012
[ https://issues.jboss.org/browse/JBIDE-12138?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12700118#comment-12700118 ]
Andre Dietisheim commented on JBIDE-12138:
------------------------------------------
I now imported into an existing project and tried to publish this. For some reason the local git repo was corrupted:
{code}
org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of push command
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:156)
at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:194)
at org.jboss.tools.openshift.egit.core.EGitUtils.push(EGitUtils.java:429)
at org.jboss.tools.openshift.egit.core.EGitUtils.pushForce(EGitUtils.java:418)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressPublishMethod.commitAndPushProject(ExpressPublishMethod.java:237)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressPublishMethod.publishFinish(ExpressPublishMethod.java:80)
at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishFinish(DeployableServerBehavior.java:94)
at org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior.publishFinish(DelegatingServerBehavior.java:147)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:974)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBehaviour.publish(ExpressBehaviour.java:27)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBehaviour.publish(ExpressBehaviour.java:34)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3087)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://7ddb1e3809e54c969a568dd03889e90f@as-minipaas.example.com/~/git/as.git/: Missing tree ecdd261c53993ae777f379662b52ceec35c2f7ed
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:186)
at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:126)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:141)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1120)
at org.eclipse.jgit.api.PushCommand.call(PushCommand.java:152)
... 14 more
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing tree ecdd261c53993ae777f379662b52ceec35c2f7ed
at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:126)
at org.eclipse.jgit.revwalk.ObjectWalk.newTreeVisit(ObjectWalk.java:726)
at org.eclipse.jgit.revwalk.ObjectWalk.nextObject(ObjectWalk.java:378)
at org.eclipse.jgit.storage.pack.PackWriter.findObjectsToPack(PackWriter.java:1706)
at org.eclipse.jgit.storage.pack.PackWriter.preparePack(PackWriter.java:707)
at org.eclipse.jgit.storage.pack.PackWriter.preparePack(PackWriter.java:670)
at org.eclipse.jgit.transport.BasePackPushConnection.writePack(BasePackPushConnection.java:265)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:168)
... 18 more
{code}
The publish then failed with an NPE:
{code}
java.lang.NullPointerException
at org.jboss.tools.openshift.egit.core.EGitUtils.getFailedUpdates(EGitUtils.java:568)
at org.jboss.tools.openshift.egit.core.EGitUtils.getFailedUpdates(EGitUtils.java:563)
at org.jboss.tools.openshift.egit.core.EGitUtils.getFailedUpdates(EGitUtils.java:557)
at org.jboss.tools.openshift.egit.core.EGitUtils.hasFailedEntries(EGitUtils.java:551)
at org.jboss.tools.openshift.egit.core.EGitUtils.push(EGitUtils.java:431)
at org.jboss.tools.openshift.egit.core.EGitUtils.pushForce(EGitUtils.java:418)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressPublishMethod.commitAndPushProject(ExpressPublishMethod.java:237)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressPublishMethod.publishFinish(ExpressPublishMethod.java:80)
at org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior.publishFinish(DeployableServerBehavior.java:94)
at org.jboss.ide.eclipse.as.core.server.internal.DelegatingServerBehavior.publishFinish(DelegatingServerBehavior.java:147)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:974)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBehaviour.publish(ExpressBehaviour.java:27)
at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774)
at org.jboss.tools.openshift.express.internal.core.behaviour.ExpressBehaviour.publish(ExpressBehaviour.java:34)
at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3087)
at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
{code}
> serveradapter is git forcing without asking when error occurs in normal git commit
> ----------------------------------------------------------------------------------
>
> Key: JBIDE-12138
> URL: https://issues.jboss.org/browse/JBIDE-12138
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Reporter: Max Rydahl Andersen
> Assignee: Rob Stryker
> Priority: Critical
> Fix For: 3.3.0.CR1
>
> Attachments: check-for-null-pushresults.patch, JBIDE-12138.patch, JBIDE-12138improved.txt
>
>
> Was noticed through reading the code that if another error than "up to date" occurs jbosstools is *forcing* a push witohut asking the user.
> This must be fixed since otherwise you are nuking users history!
> Steps to reproduce:
> # create myapp in tools with openshift in ~/git/myapp
> # take the git url and clone the app into a separate directory (to simulate other changes)
> mkdir temp
> cd temp
> git clone ssh:<specifichost>/myapp.git/
> cd myapp
> edit README or some other existing file
> git commit -m "external change" README
> git push
> <ton of output>
> cd ~/git/myapp
> git push will now fail with something like:
> ax at slowbeard: $ git push ~/git/appmy
> To ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/
> ! [rejected] master -> master (non-fast-forward)
> error: failed to push some refs to 'ssh://b8ab8a46a2984d16b1666f3b172c4199@appmy-man.rhcloud.com/~/git/appmy.git/'
> To prevent you from losing history, non-fast-forward updates were rejected
> Merge the remote changes (e.g. 'git pull') before pushing again. See the
> 'Note about fast-forwards' section of 'git push --help' for details.
> Thus when trying to publish from tools it should *not* let you push and it should ask you before pushing with force.
> You can verify it did not push force by using
> git pull
> git log README
> and check that "external change" is still present.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jbosstools-issues
mailing list