Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » 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 00:04 Go to next message
Navgeet Agrawal is currently offline Navgeet Agrawal
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 02:48 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 02:49 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 02:50 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 02:50 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 02:51 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 18:59 Go to previous message
Matthias Sohn is currently offline Matthias Sohn
Messages: 548
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 Jul 31 03:26:00 EDT 2014

Powered by FUDForum. Page generated in 0.02167 seconds