Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit - expose a commit's source tree as a filesystem to classpath
JGit - expose a commit's source tree as a filesystem to classpath [message #1079772] Mon, 05 August 2013 04:04 Go to next message
Navgeet Agrawal is currently offline Navgeet AgrawalFriend
Messages: 1
Registered: August 2013
Junior Member
I am pretty new to JGit and git in general so this question may come of as noobish. Here is what I want to achieve:

For a particular commit, expose its source tree as an in-memory filesystem and add it to a certain classpath. I want to avoid shelling to git, checking out the commit and adding the git project's directory to classpath because of the implications of a dirty working directory. Is this doable with JGit?
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1141734 is a reply to message #1079772] Thu, 17 October 2013 06:48 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- use a RevWalk to travel to the RevCommit you want
- get the commit's tree ("the file system of this version")
- use a TreeWalk to walk the version's filesystem tree
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1141735 is a reply to message #1079772] Thu, 17 October 2013 06:49 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- use a RevWalk to travel to the RevCommit you want
- get the commit's tree (the version's "file system")
- traverse this tree using a TreeWalk
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1141737 is a reply to message #1079772] Thu, 17 October 2013 06:50 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- use a RevWalk to travel to the RevCommit you want
- get the commit's tree (the version's "file system")
- traverse this tree using a TreeWalk
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1141738 is a reply to message #1079772] Thu, 17 October 2013 06:50 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- use a RevWalk to travel to the RevCommit you want
- get the commit's tree (the version's "file system")
- traverse this tree using a TreeWalk
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1141744 is a reply to message #1079772] Thu, 17 October 2013 06:51 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
- use a RevWalk to travel to the RevCommit you want
- get the commit's tree (the version's "file system")
- traverse this tree using a TreeWalk
Re: JGit - expose a commit's source tree as a filesystem to classpath [message #1142892 is a reply to message #1141744] Thu, 17 October 2013 22:59 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
sorry for posting my answer multiple times,
this was caused by https://bugs.eclipse.org/bugs/show_bug.cgi?id=419661
Previous Topic:Filter tags in Git Repository view
Next Topic:merge all branches
Goto Forum:
  


Current Time: Thu Apr 25 10:53:24 GMT 2024

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

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

Back to the top