Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Getting changed files from commitId(SHA-1)(I want to get the set of changed files from the commitId )
icon5.gif  Getting changed files from commitId(SHA-1) [message #1402567] Thu, 17 July 2014 07:03 Go to next message
neo sunny is currently offline neo sunnyFriend
Messages: 1
Registered: July 2014
Junior Member
My Requirement Is like this:
(1)I want to get the commitIds for a local user who has commited the changes but not pushed into repository.I want only those commitIds which are commited only after Last push from his local machine.

(2)Based on those CommitIds i want to get set of files affected for each commitId(i.e the files which were changed in a particular commit).

I am struggling on this from last week. Anyhelp ASAP would be good for me.If You know solution of any part, Please Help. Thanks in advance.
Re: Getting changed files from commitId(SHA-1) [message #1403392 is a reply to message #1402567] Wed, 23 July 2014 12:00 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1269
Registered: July 2009
Senior Member
To identify the commits which aren't available on the server yet:
- run fetch to ensure your remote tracking branches are in sync with the remote repository
- do a RevWalk starting (walk.markStart()) from all local branches and stop this walk (walk.markUninteresting())
on any remote tracking branch to find the interesting commits

To determine which files have been changed in a commit use DiffFormatter.scan initialized with the tree of
the commit and the tree of its parent commit. See JGit's implementation of git log --name-status in
http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Log.java#n353
Re: Getting changed files from commitId(SHA-1) [message #1403448 is a reply to message #1403392] Wed, 23 July 2014 18:51 Go to previous message
sakshi kaushik is currently offline sakshi kaushikFriend
Messages: 5
Registered: July 2014
Junior Member
I am facing a similar issue. How can I visually see unpushed files in eclipse? Do I always have to run commands in order to get a list of files that are committed but not yet pushed? Can't I see it anyhow?
Previous Topic:Reword: Add change id for gerrit
Next Topic:Why do (all) eclipse projects have a .gitignore per plug-in project?
Goto Forum:
  


Current Time: Thu May 09 11:43:36 GMT 2024

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

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

Back to the top