Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 340121 - Edits on Egit Synchronize does not get saved back to the workspace
Summary: Edits on Egit Synchronize does not get saved back to the workspace
Status: CLOSED WORKSFORME
Alias: None
Product: EGit
Classification: Technology
Component: Core (show other bugs)
Version: 0.11   Edit
Hardware: Other All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 04:46 EDT by Max Rydahl Andersen CLA
Modified: 2012-04-19 17:34 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Max Rydahl Andersen CLA 2011-03-16 04:46:52 EDT
I noticed that even though I saved the comparison editor when using the 
Synchronize view the changes did not make it back to the workspace loosing all 
my changes.

Steps to reproduce:
Have a git repo with uncommitted changes
Run Synchronize
Double click a changed file to see the diff
Make some changes in the file
Save the editor
Open the file in a normal editor
Changes have not been saved!
Comment 1 Max Rydahl Andersen CLA 2011-03-16 05:10:55 EDT
not sure if this is related but I got this in my error log:

org.eclipse.jgit.errors.MissingObjectException: Missing tree 
0000000000000000000000000000000000000000
	at org.eclipse.jgit.storage.file.WindowCursor.open(WindowCursor.java:114)
	at 
org.eclipse.jgit.treewalk.CanonicalTreeParser.reset(CanonicalTreeParser.java:193)
	at org.eclipse.jgit.treewalk.TreeWalk.parserFor(TreeWalk.java:968)
	at org.eclipse.jgit.treewalk.TreeWalk.addTree(TreeWalk.java:461)
	at 
org.eclipse.egit.ui.internal.synchronize.model.GitModelTree.getChildrenImpl(GitModelTree.java:110)
	at 
org.eclipse.egit.ui.internal.synchronize.model.GitModelObjectContainer.getChildren(GitModelObjectContainer.java:115)
	at 
org.eclipse.egit.ui.internal.synchronize.mapping.GitChangeSetContentProvider.hasChildren(GitChangeSetContentProvider.java:50)
	at 
org.eclipse.ui.internal.navigator.extensions.SafeDelegateTreeContentProvider.hasChildren(SafeDelegateTreeContentProvider.java:110)
	at 
org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.callNormalHasChildren(NavigatorContentServiceContentProvider.java:428)
	at 
org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.access$4(NavigatorContentServiceContentProvider.java:423)
	at 
org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider$3.run(NavigatorContentServiceContentProvider.java:393)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at 
org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:379)
	at 
org.eclipse.ui.internal.navigator.NavigatorContentServiceContentProvider.hasChildren(NavigatorContentServiceContentProvider.java:420)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2082)
	at org.eclipse.jface.viewers.TreeViewer.isExpandable(TreeViewer.java:588)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.isExpandable(AbstractTreeViewer.java:2112)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.updatePlus(AbstractTreeViewer.java:2794)
	at org.eclipse.jface.viewers.TreeViewer.updatePlus(TreeViewer.java:852)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:830)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer$1.run(AbstractTreeViewer.java:804)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:778)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:644)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1714)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.internalExpandToLevel(AbstractTreeViewer.java:1724)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1056)
	at 
org.eclipse.jface.viewers.AbstractTreeViewer.expandToLevel(AbstractTreeViewer.java:1037)
	at 
org.eclipse.team.internal.ui.mapping.CommonViewerAdvisor.setInitialInput(CommonViewerAdvisor.java:360)
	at 
org.eclipse.team.internal.ui.synchronize.AbstractSynchronizePage.createChangesViewer(AbstractSynchronizePage.java:132)
	at 
org.eclipse.team.internal.ui.synchronize.AbstractSynchronizePage.createControl(AbstractSynchronizePage.java:113)
	at 
org.eclipse.team.internal.ui.synchronize.SynchronizeView.doCreatePage(SynchronizeView.java:239)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:408)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:751)
	at 
org.eclipse.team.internal.ui.synchronize.SynchronizeView.display(SynchronizeView.java:441)
	at 
org.eclipse.team.internal.ui.synchronize.SynchronizeView.updateForExistingParticipants(SynchronizeView.java:560)
	at 
org.eclipse.team.internal.ui.synchronize.SynchronizeView.createPartControl(SynchronizeView.java:515)
	at 
org.eclipse.ui.internal.ViewReference.createPartHelper(ViewReference.java:375)
	at org.eclipse.ui.internal.ViewReference.createPart(ViewReference.java:229)
	at 
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
	at org.eclipse.ui.internal.ViewPane.setVisible(ViewPane.java:529)
	at 
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
	at 
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
	at 
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at 
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
	at 
org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1254)
	at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1207)
	at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1606)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:647)
	at org.eclipse.ui.internal.PartStack.createControl(PartStack.java:574)
	at 
org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:568)
	at 
org.eclipse.ui.internal.PerspectiveHelper.activate(PerspectiveHelper.java:272)
	at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:981)
	at 
org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3614)
	at 
org.eclipse.ui.internal.WorkbenchPage.busySetPerspective(WorkbenchPage.java:1041)
	at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:1025)
	at org.eclipse.ui.internal.WorkbenchPage$19.run(WorkbenchPage.java:3715)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at 
org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3713)
	at org.eclipse.ui.internal.Workbench.showPerspective(Workbench.java:2814)
	at 
org.eclipse.team.internal.ui.synchronize.SynchronizeManager.showSynchronizeViewInActivePage(SynchronizeManager.java:461)
	at 
org.eclipse.team.internal.ui.synchronize.RefreshUserNotificationPolicy$1.run(RefreshUserNotificationPolicy.java:47)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3586)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3279)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at 
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
	at 
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at 
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Comment 2 Dariusz Luksza CLA 2011-03-16 17:51:25 EDT
Currently we don't allow edit files in compare editor because you we are using same code for displaying changes between working dir vs. repository and between two commits. In case of comparing changes between two commits you can't modify file version in given commit.
Comment 3 Matthias Sohn CLA 2011-03-29 04:06:25 EDT
so this is a missing feature and not a bug
Comment 4 Max Rydahl Andersen CLA 2011-03-30 09:59:53 EDT
(In reply to comment #2)
> Currently we don't allow edit files in compare editor because you we are using
> same code for displaying changes between working dir vs. repository and between
> two commits. In case of comparing changes between two commits you can't modify
> file version in given commit.

If you don't allow editing, how come the editors react to editing ?
Comment 5 Dariusz Luksza CLA 2011-05-29 07:39:10 EDT
I've test saving changes in compare view launched from sync-view and it works fine in EGit 1.0.0.201105261513. It seams that one of recent changes fix this issue and I don't have anything against it, now when we always synchronize against HEAD and we can persist changes without any problems.
Comment 6 Matthias Sohn CLA 2012-04-19 17:34:08 EDT
tested with today's 2.0.0-SNAPSHOT and this works properly