Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Git command equivalent in JGit (diff & Show)
Git command equivalent in JGit (diff & Show) [message #1707053] Tue, 01 September 2015 20:54 Go to next message
Purnashree Bhattacharya is currently offline Purnashree BhattacharyaFriend
Messages: 1
Registered: September 2015
Junior Member
Hi,

I am very new to Git and I have a task of automating database script generation for deployment. Now I came across the Java APIs to connect to Git and this seems very useful in achieving this.

I am looking to do the equivalent of the following 2 commands using JGit:

git diff --name-status @{2015-08-13T10:00:00-00:00}..@{2015-09-01T10:00:00-00:00}
- I need to code and get this in the Java API, so that after I retrieve all the files changed within a certain date range, I get only selected files (within certain directory structure) and then read the contents of those files.

git show :0:./<FileName>
- need to read the file content and create a script with additions/modifications.

Please can you let me know the JGit equivalents of the above commands?

Thanks.
Re: Git command equivalent in JGit (diff & Show) [message #1707122 is a reply to message #1707053] Wed, 02 September 2015 13:02 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
Moving this to the EGit/JGit forum.
Re: Git command equivalent in JGit (diff & Show) [message #1707689 is a reply to message #1707122] Tue, 08 September 2015 13:51 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1268
Registered: July 2009
Senior Member
JGit's Diff class supports diff --name-status so start digging here
http://git.eclipse.org/c/jgit/jgit.git/tree/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Diff.java#n115
Previous Topic:EGit not remembering SSH passphrase
Next Topic:[RESOLVED] Git options are enabled for "Team" submenu, but DISabled for Git 'top-menu'?
Goto Forum:
  


Current Time: Thu Apr 25 09:43:41 GMT 2024

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

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

Back to the top