Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:29 Go to next message
Steve Luo is currently offline Steve LuoFriend
Messages: 3
Registered: April 2012
Junior Member
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 15:38]

Report message to a moderator

Re: How to parse relative revision by JGit [message #844021 is a reply to message #843995] Fri, 13 April 2012 15:55 Go to previous message
Steve Luo is currently offline Steve LuoFriend
Messages: 3
Registered: April 2012
Junior Member
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: Tue Apr 23 14:27:44 GMT 2024

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

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

Back to the top