| Summary: | Add git rebase | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Szymon Brandys <Szymon.Brandys> |
| Component: | Git | Assignee: | Szymon Brandys <Szymon.Brandys> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | janikpiotrek, tomasz.zarna |
| Version: | 0.2 | Flags: | Szymon.Brandys:
review+
|
| Target Milestone: | 0.3 M1 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | gsoc2011 | ||
| Bug Depends on: | |||
| Bug Blocks: | 351458 | ||
|
Description
Szymon Brandys
Proposal: https://github.com/pjanik/orion.client/tree/bug351429 https://github.com/pjanik/orion.server/tree/bug351429 I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use. I will write more server tests in the nearest future. I publish it now to gain some opinions in the meantime. :) Ok, tests updated. 1. When I try to rebase changes and there are unstaged or uncommitted changes I get js errors. I need to stage and commit first then I can continue. 2. Abort Skip patch and continue on the status page end up with POST http://localhost:8080/gitapi/commit/HEAD/file/a0/ 500 Internal Server Error 40ms xhr.js (line 880) Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 var err = new Error("Unable to load...Args.url + " status:" + xhr.status); xhr.js (line 774) HTTP status code: 500 gitClient.js (line 674) GET http://localhost:8080/gitapi/status/file/a0/ 200 OK 263ms xhr.js (line 880) Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 var err = new Error("Unable to load...Args.url + " status:" + xhr.status); xhr.js (line 774) Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 var err = new Error("Unable to load...Args.url + " status:" + xhr.status); or something similar 3. I saw "(warning) OK. Go to Git Status page." in the status bar, even if the rebase succeeded. 4. Use commands with icons for Continue, Abort etc. (In reply to comment #3) > 1. When I try to rebase changes and there are unstaged or uncommitted changes I > get js errors. I need to stage and commit first then I can continue. Yes, it is how Git works. ;) To rebase, repository has to be in proper state. When I've tried to repeat your steps, I've got error message: Checkout conflict with file: [file_name]. It's expected, and it's probably JGit equivalent of: - "Cannot rebase: You have unsateged changes. Please commit or stash them." - "Cannor rebase: Your index contains uncommited changes. Please commit or stash them." what we can see in Git console version. JS errors - there was an error, so it's logged. Ofc I can disable it, but i.e. when cloning fails (i.e. random URL), there are JS errors logged too. > 2. Abort Skip patch and continue on the status page end up with > > POST http://localhost:8080/gitapi/commit/HEAD/file/a0/ > > 500 Internal Server Error > 40ms > xhr.js (line 880) > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > xhr.js (line 774) > HTTP status code: 500 > gitClient.js (line 674) > GET http://localhost:8080/gitapi/status/file/a0/ > > 200 OK > 263ms > xhr.js (line 880) > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > xhr.js (line 774) > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > > or something similar I think that's the same case as above. Wrong repository state for "continue" operations. I guess that your probably skipped one patch, but there were still some conflicts after that operation (I'm almost sure, as "rebase panel" is shown in the rebase repository state, which is active only when there are some conflicts which are waiting to be resolved). So, you clicked "continue" without resolving conflicts, what is an error. I think that it's expected. To avoid this error you should: - abort, - skip patch again, - resolve conflict and only then continue. JS errors - they are logged as always. By the way, I think that HTTP 500 isn't best HTTP response code in such cases, so I will change it. ;) > 3. I saw "(warning) OK. Go to Git Status page." in the status bar, even if the > rebase succeeded. Right, it's a bug. Fixed. > 4. Use commands with icons for Continue, Abort etc. Instead of buttons with text? Or just add icons next to the text? (In reply to comment #4) > (In reply to comment #3) > > 1. When I try to rebase changes and there are unstaged or uncommitted changes > I > > get js errors. I need to stage and commit first then I can continue. > Yes, it is how Git works. ;) To rebase, repository has to be in proper state. > When I've tried to repeat your steps, I've got error message: Checkout conflict > with file: [file_name]. It's expected, and it's probably JGit equivalent of: > - "Cannot rebase: You have unsateged changes. Please commit or stash them." > - "Cannor rebase: Your index contains uncommited changes. Please commit or stash > them." > what we can see in Git console version. I should have been more precise. I got JS error that has nothing in common with your "Checkout conflict with file: [file_name"] warning. I will try to reproduce and paste the exact message. > JS errors - there was an error, so it's logged. Ofc I can disable it, but i.e. > when cloning fails (i.e. random URL), there are JS errors logged too. Of course you should log errors. But the warning about incorrect repo state is something expected, so it should be shown in the status bar and the user should be asked to go to the status page to handle the problem. So far we may also log it. My issue was, that there was no link to the status page. > > 2. Abort Skip patch and continue on the status page end up with > > > > POST http://localhost:8080/gitapi/commit/HEAD/file/a0/ > > > > 500 Internal Server Error > > 40ms > > xhr.js (line 880) > > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > > xhr.js (line 774) > > HTTP status code: 500 > > gitClient.js (line 674) > > GET http://localhost:8080/gitapi/status/file/a0/ > > > > 200 OK > > 263ms > > xhr.js (line 880) > > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > > xhr.js (line 774) > > Error: Unable to load /gitapi/commit/HEAD/file/a0/ status:500 > > var err = new Error("Unable to load...Args.url + " status:" + xhr.status); > > > > or something similar > I think that's the same case as above. Wrong repository state for "continue" > operations. I guess that your probably skipped one patch, but there were still > some conflicts after that operation (I'm almost sure, as "rebase panel" is shown > in the rebase repository state, which is active only when there are some > conflicts which are waiting to be resolved). I was just clicking around. Nothing was shown in the status bar, just the console. And as you see errors say nothing. > > 4. Use commands with icons for Continue, Abort etc. > Instead of buttons with text? Or just add icons next to the text? Commands. If they are commands we can easily change it into text or icon later. (In reply to comment #5) > I should have been more precise. I got JS error that has nothing in common with > your "Checkout conflict with file: [file_name"] warning. I will try to reproduce > and paste the exact message. Sorry, I can't reproduce it now. The remaining issue though is to show the git status page link, if there are checkout conflicts related to unstaged or uncommitted changes. https://github.com/pjanik/orion.client/tree/bug351429 https://github.com/pjanik/orion.server/tree/bug351429 The most obvious errors are handled. I've changed Continue, Abort and Skip to commands. We were chatting online yesterday about the problem with rebase --continue in some cases. Steps: 1) I have a repo cloned from ssh://sbrandys@git.eclipse.org/gitroot/orion/org.eclipse.orion.client.git 2) Add a remote using url git://github.com/pjanik/orion.client.git 3) Check out the bug351440 branch from pjanik remote 4) Try to rebase using master, you'll be asked to go to Git Status to resolve conflicts 5) Fix the conflicts using the git status page and compare views 6) Try to Continue and nothing happens Two calls are made after 'Continue' is clicked POST http://localhost:8080/gitapi/commit/HEAD/file/a5/ with {"RebaseOperation":"CONTINUE"} and the result is {"Result": "FAST_FORWARD"} then GET http://localhost:8080/gitapi/status/file/a5/ and the result is { "Added": [], "Changed": [], "CloneLocation": "/gitapi/clone/file/a5/", "CommitLocation": "/gitapi/commit/HEAD/file/a5/", "Conflicting": [], "IndexLocation": "/gitapi/index/file/a5/", "Missing": [], "Modified": [], "Removed": [], "RepositoryState": "REBASING_INTERACTIVE", "Untracked": [] } Pressing Continue calls RebaseCommand in GitCommithandletV1#rebase, so it may be a bug in JGit. When I try to rebase --continue in the console it ends the rebase and leaves the interactive mode. I can reproduce it all the time. Piotrek,3 of 5 rebase tests fail. I checked that on another machine so it is not just me. For me it looks like the tests are not adjusted to the recent code changes. Fixed. We will raise new bugs for further work in this area. |