0

i'm a beginner java developer, i need to use eclipse and i have some questions about eclipse/github/egit/jgit/travis.

  1. I need to get the commits made on a repository in github. I found on the internet that this is possible with both jgit and egit and more in depth that egit uses jgit. My first question is: are jgit and egit functionally equivalent? (all i can do with egit i can do it with jgit and vice versa)?
  2. To get the date of a commit with egit I have to write something like commit.getAuthor().getDate(), why does this work? That is, commit.getAuthor() returns an instance of the class CommitUser, why a method of the class CommitUser returns the commit date? shouldn't getDate() be a method of the class Commit?
  3. My project must be loaded into a repository managed through SVN and on which I will have to use the tools travis and sonarcloud. My question is: how does the management of external jars added to the project take place when I use travis and sonarcloud? Will I get errors? How should I handle them?
fabianod
  • 501
  • 4
  • 17
  • Poor title. Rewrite to summarize your specific technical issue. – Basil Bourque Mar 28 '20 at 16:24
  • @DavidM.Karr first: your comment doesn't help. second: I have to analyze a project that has 2617 commits, doing this manually is madness. third: I don't think I'm the first or the last to do this since there are tools to support it, so I don't see what's so strange that needs to be underlined by a comment. – fabianod Mar 29 '20 at 14:36

1 Answers1

0
  1. JGit is a Java implementation of Git and used by EGit (= Eclipse IDE Git support) and other Java applications and frameworks, e.g. by Gerrit.
  2. That's JGit, not EGit. A commit has two dates, the authored date (when it was committed) and the committed date (when it was pushed).
  3. In a plain Java application JGit can be used as Maven dependency, the Eclipse IDE is not required to build your application.
howlger
  • 31,050
  • 11
  • 59
  • 99
  • Thank you for your answer. Just to be safe about the point 2: the code I wrote above are taken from my project whose imports are: `import org.eclipse.egit.github.core.Repository; import org.eclipse.egit.github.core.RepositoryCommit; import org.eclipse.egit.github.core.client.GitHubClient; import org.eclipse.egit.github.core.service.CommitService; import org.eclipse.egit.github.core.service.RepositoryService;`. As you can see, i don't have imports like `org.eclipse.jgit.api.Git`. – fabianod Mar 29 '20 at 14:52
  • [`org.eclipse.egit.github.core`](https://git.eclipse.org/c/egit/egit-github.git/tree/) is the GitHub Mylyn integration for EGit (for GitHub specific stuff like issue tracker, etc.). To get the commits made on a Git repository you should use JGit only. At least that's how I did it. – howlger Mar 29 '20 at 15:06