| Summary: | Revert Failed Error | ||
|---|---|---|---|
| Product: | [Technology] EGit | Reporter: | Miles Parker <milesparker> |
| Component: | UI | Assignee: | Kevin Sawicki <kevin> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 1.1 | ||
| Target Milestone: | 1.2 | ||
| Hardware: | Macintosh | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Miles Parker
Can you elaborate a bit about what was in the commit you wanted to revert? Was it all added files, edited files, deleted files? All of the above. It was a pretty significant refactoring, so it involved renamed, moved, and deleted files as well as quite a few edits. I'm sorry, that probably doesn't help much. This is hard to reproduce without more detailed information on what you did. What do you mean by revert to the previous commit ? Do you want to remove the last commit from the history and rewind the working tree to that state ? Then you should rather do a hard reset on the previous commit. Revert creates another commit on top of current HEAD which applies the opposite diff of the commit you clicked "revert" on. So it's not removing the last commit but adding another one on top which reverts the effect of the previous commit (diff is reverse of the previous commit). (In reply to comment #3) > This is hard to reproduce without more detailed information on what > you did. > > What do you mean by revert to the previous commit ? Do you want to > remove the last commit from the history and rewind the working tree > to that state ? Then you should rather do a hard reset on the previous > commit. Yes, that's what I ended up doing. But the docs seemed to indicate that this was a better way to go. http://wiki.eclipse.org/EGit/User_Guide#Reverting_changes_introduced_by_a_specific_commit "Changes which are introduced by a given commit can be reverted by an automatically created new commit on top of the currently checked out commit. The commit which is to be reverted does not have to be checked out for that." My thinking was that this way I could avoid having to deal with merging all of the changes back in to my upstream repos. As it turns out, I didn't have to, but I *did* lose the record of my changes that I had rolled back, which isn't ideal. > Revert creates another commit on top of current HEAD which applies > the opposite diff of the commit you clicked "revert" on. So it's not > removing the last commit but adding another one on top which reverts > the effect of the previous commit (diff is reverse of the previous commit). Right, that's exactly what I wanted to do. IOTW, I wanted to keep the linear record of the change that I had made. Ideally I guess I would have created a branch for that, but I wasn't thinking ahead. Anyway, the basic issue is the error, not whether it was the right thing to do or not. :) And the part of that that is really the concern is how the error was presented. There seems to be a hole in the exception handling somewhere. But sorry, beyond the basic explanation of the steps I took, I can't think of anything to suggest in terms of reproducing. I'm assuming that you tried [or a unit test exists for] doing a number of changes and then triggering that option. One other thought I had on this.. I'm doing a lot of code generation as part of this. When that happens, it's always possible that the Eclipse file system wasn't synched properly prior to the commit. I usually try to do that manually before a commit just to be sure...but a possibility that there might have been some kind of inconsistent state there. JGit now provides the reason behind a revert failure so we can now give a better message in EGit when this happens. I am working on a new dialog that shows why the revert failed such as dirty index, dirty working tree, or failure to delete files. (In reply to comment #6) > JGit now provides the reason behind a revert failure so we can now give a > better message in EGit when this happens. > > I am working on a new dialog that shows why the revert failed such as dirty > index, dirty working tree, or failure to delete files. OK, that works for me. As I say, the real issue for me was just not having anything to go on at all. You could just make this one a dup of that or however you want to resolve it. Pushed new revert error dialog: http://egit.eclipse.org/r/#change,4695 Screenshot here: http://img.skitch.com/20111129-gsn29wxtpmreu1wjig3astetew.png (In reply to comment #8) +1 Merged into master as commit ed315802df8ad278ad257a675c9cb86f11e02213 |