Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » How to parse relative revision by JGit
How to parse relative revision by JGit [message #843995] Fri, 13 April 2012 11:29 Go to next message
Eclipse UserFriend
git-rev-parse can parse below syntax:
HEAD~100
to a SHA1 commit, is there any similar function in JGit can deal with it or I have to iterate with the tree walk like:
RevWalk rw = new RevWalk(db);
rw.markStart(rw.parseCommit(db.resolve(HEAD));
for (int i = 0; i < 100; i++)
   rw.next();

[Updated on: Fri, 13 April 2012 11:38] by Moderator

Re: How to parse relative revision by JGit [message #844021 is a reply to message #843995] Fri, 13 April 2012 11:55 Go to previous message
Eclipse UserFriend
I just notice that db.resolve() support this syntax.
Please ignore this question.
Previous Topic:Wrong behaviour of EGit
Next Topic:Cannot resolve dirty folder (Win7)
Goto Forum:
  


Current Time: Sun Jun 15 18:17:15 EDT 2025

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

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

Back to the top