Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [egit-dev] EGit PDE - help with EGit/JGit

On Fri, Oct 29, 2010 at 7:39 AM, Paul Webster
<pwebster@xxxxxxxxxxxxxxxxxxx> wrote:
> I thought Shawn's algorithm was for "git tag --contains"?  I still
> need to find the last commit that effects a specific project.  If the
> PathFilter itself doesn't work, how do I get the list of changed files
> out of a commit?  It's probably RevTree, right?

OK, I'm stumped.

If I get the latest commit in the repo, how do I find out the files
included in the commit?

What I tried:
my commit = d660f0a07c8ff16c9b46b3d69bc1c271b2cf4aba
String repoRelativePath = "bundles/org.eclipse.e4.core.deeplink.handler";
final TreeWalk treeWalk = TreeWalk.forPath(repo, repoRelativePath,
		commit.getTree());
final String pathString = treeWalk.getPathString();

pathString = bundles/org.eclipse.e4.core.deeplink.handler/.classpath

of course, any check I do now will show that my repoRelativePath contains this.

The origin example with
walk.setTreeFilter(PathFilter.create(repoRelativePath)); failed in a
similar way (it always returned the latest commit, even though there's
only one file in it and it is not contained in repoRelativePath).


If I'm trying to find the files for a commit, what I'd actually expect to see:
bash-3.2$ git show --pretty="format:" --name-only
d660f0a07c8ff16c9b46b3d69bc1c271b2cf4aba

bundles/org.eclipse.e4.core.deeplink/META-INF/MANIFEST.MF

This is the file that changed in that commit.


-- 
Paul Webster
Hi floor.  Make me a sammich! - GIR


Back to the top