Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Cannot revert commit
Cannot revert commit [message #1843473] Sat, 31 July 2021 12:30 Go to next message
Eclipse UserFriend
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 13:35 Go to previous messageGo to next message
Eclipse UserFriend
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 14:04 Go to previous message
Eclipse UserFriend
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: Sat May 17 02:08:36 EDT 2025

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

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

Back to the top