Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Cannot revert commit
Cannot revert commit [message #1843473] Sat, 31 July 2021 16:30 Go to next message
Yuriy Mitrofanov is currently offline Yuriy MitrofanovFriend
Messages: 16
Registered: July 2021
Junior Member
When I use git I have no error:
C:\Projects\repo4>git revert 59107f2 -m 1 [master 38729f3] Revert "Merge pull request #1 from robfrank/master"
2 files changed, 684 insertions(+), 696 deletions(-)

When I use jgit I get an error:
ObjectId id = git.getRepository().resolve(revertid);
RevCommit commit = new RevWalk(git.getRepository()).parseCommit(id.toObjectId());
RevCommit revertCommand = git.revert().include(commit).call();

Cannot revert commit '59107f2328b82cd9c34986863ac648341bf705c6' because it has 2 parents, only commits with exactly one parent are supported

Is there an easy way to solve this problem?
Re: Cannot revert commit [message #1843474 is a reply to message #1843473] Sat, 31 July 2021 17:35 Go to previous messageGo to next message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 508
Registered: August 2016
Senior Member
Yes. Implement the --mainline option for JGit's RevertCommand and contribute the code :-). But see also what the git documentation has to say about reverting merge commits.
Re: Cannot revert commit [message #1843476 is a reply to message #1843474] Sat, 31 July 2021 18:04 Go to previous message
Yuriy Mitrofanov is currently offline Yuriy MitrofanovFriend
Messages: 16
Registered: July 2021
Junior Member
Thomas Wolf wrote on Sat, 31 July 2021 17:35
Yes. Implement the --mainline option for JGit's RevertCommand and contribute the code :-). But see also what the git documentation has to say about reverting merge commits.


A very simple way )))))))))))))))))))))
Previous Topic:Create binary diff and apply binary diff
Next Topic:Wrong file hash
Goto Forum:
  


Current Time: Sun Nov 27 06:57:59 GMT 2022

Powered by FUDForum. Page generated in 0.03181 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top