| Summary: | [client] Unstaging selected file causes error | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | libing wang <libingw> | ||||||
| Component: | Git | Assignee: | Tomasz Zarna <tomasz.zarna> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | Szymon.Brandys | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 0.3 | ||||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | 347856, 348524, 352348 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
libing wang
(In reply to comment #0) > POST http://localhost:8080/git/index/file/Z/ with {"Path":["file1.js"]} > There is no error from the post response , but after the post I am getting > file1.js on both unstaged and staged. This is strange, but it looks like a bug in JGit, I've opened bug 347856 for it. > POST http://localhost:8080/git/index/file/K/ with > {"Path":["bundles/org.eclipse.orion.client.git/static/js/git-status-table.js"]} > I am getting errors like : > > {"HttpCode":500,"DetailedMessage":"Invalid mode 40000 for path > bundles","Message":"Failed to process an operation on index for > file/K/","Severity":"Error","Code":0} I was able to reproduce it, but have no clue what does it mean. Will check that tomorrow. Need to wait till JGit bug is fixed. Libing, have you reverted the change that allowed to unstage a single file? Could you at least give me a hint how can I enable it in my workspace? (In reply to comment #3) > Libing, have you reverted the change that allowed to unstage a single file? > Could you at least give me a hint how can I enable it in my workspace? Yeah , please go to git-status-table.js The go to where unstage command is defined : var unstageCommand = new mCommands.Command At function visibleWhen, visibleWhen: function(item) { return false;//(item.type === "fileItem" && self._model.isStaged(item.object.type)); } Just uncomment the return value(Current I am always hiding it) (In reply to comment #1) > > I am getting errors like : > > > > {"HttpCode":500,"DetailedMessage":"Invalid mode 40000 for path > > bundles","Message":"Failed to process an operation on index for > > file/K/","Severity":"Error","Code":0} > > I was able to reproduce it, but have no clue what does it mean. Will check that > tomorrow. See blocking bug 348524. I'm afraid we will need to keep the action hidden until JGit guys respond. EGit gives you an option to unstage a single file: open Git Staging view and drag'n'drop files between Staged and Unstaged section. The bad news is that under the hood they not using ResetCommand[1], which we tried to leverage here, but they modify the index tree directly[2]. [1] org.eclipse.jgit.api.ResetCommand [2] org.eclipse.egit.ui.internal.staging.StagingView.unstage(IStructuredSelection) Since hacking it on our side doesn't sound like a good idea at this point I'm changing target milestone to 0.3. Hopefully, guys from JGit will find some time to look at the provided patch. Created attachment 199565 [details]
Test that used to fail.
Both blocking bugs have been fixed (actually, one of them turned out to be a dupe). The attached test case used to fail without the fix in JGit. Now it's green. I'll wait til the fix finds its way to JGit nighty build and release changes in Orion then.
Created attachment 199566 [details]
mylyn/context/zip
This is still blocked by bug 352348, which in turn blocked by two bugs in JGit: bug 353867, bug 355205. If they're not fixed within a week or so I will change the target to 0.4. To match the reality. This should be fixed now as verified in bug 352348. The UI action has been re-enabled in http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=38840c1d039ce6ca6a8a3f76be6461af22460bbf. |