Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[egit-dev] Fwd: Integration with Git

Hi Matthias

Please find my replies to your questions below.


---------- Forwarded message ---------
From: khayati ohri <khayati.ohri@xxxxxxxxx>
Date: Wed, Jul 29, 2020 at 11:48 PM
Subject: Re: [egit-dev] Integration with Git
To: Matthias Sohn <matthias.sohn@xxxxxxxxx>
Cc: EGit developer discussion <egit-dev@xxxxxxxxxxx>

Hi Matthias

Thanks for the prompt reply. Please find my replies to your questions below :-
  • We have the following Git API through which we can fetch commit details. We don't have its alternative in EGit or JGit you mean ?
  • Yes you are absolutely right but what I am aiming is to actually fetch the latest and latest - 1 version of all the files in a commit by using/integrating with Git libraries so that the same can be populated in my tool .
  • Yes I was actually referring to this But I  believe this is just a small part of Egit plugin and you are pointing to use Jgit dierctly on which Egit is based upon to gain maximum functionality ? Though I did see various services provided by org.eclipse.egit.github.core but I couldn't find any service which can extract the history of files or compare 2 commits of a file for me.
  • Thanks for acknowledging  but can you tell me a general idea as what these limits would be for a Git server ?
  • I believe it means we cannot see others uncommitted changes unless and until they are pushed to Git server and that probably why as of today GitHUb allows to provide Pull request in committed changes only ?
Once again thanks alot for your cooperation


On Tue, Jul 28, 2020 at 6:05 PM Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
On Tue, Jul 28, 2020 at 11:45 AM khayati ohri <khayati.ohri@xxxxxxxxx> wrote:
I am looking forward to integrate Git with my tool. Following are the operations I am looking forward.
  • We will be using Commit ID to fetch the commit details .

git servers typically do not allow to fetch based on commitId for security reasons. Normally they only allow to fetch based on refs (branches, tags) 
  • Once we get the list of files from previous point we want to fetch the latest file content (n version) as well as (n-1 version). 

I don't understand this  question. Git is a distributed versioning system this means you typically  have a clone of the repository
which contains the complete history of the project. Hence there is no need to fetch again to access file content. 
  • Can we use Git SDK to programmatically access n and n-1 file contents in a commit ?

I don't  know which SDK you are referring to. EGit is based on JGit API [1]. 
  • What are the max size lengths for GIT repo URL, COMMIT ID and COMMIT MESSAGE ?

 JGit and EGit do not limit the size of url and commit message but your git server may have limits.
So far commitIds are fixed size SHA1 hashes. This may change when the migration to SHA-256 [2] lands in native git. 
  • Also we wanted to know if we could enable reviewing of GIT changes before they are committed by picking them from the local author workspace. In RTC this was possible as the users outgoing changesets could be read from the users repository workspace on the server even if it was not delivered. We do not find a way to achieve this in GIT. Do you have any suggestions on this?

Again git is a distributed versioning system where you don't have access to the local workspace of an author.
The usual way to implement code review with git is to create a commit in a user's local clone and share it via
git transport to another git repository (or send it via email as linux does) most often this repository is a server
which is always available but also peer to peer scenarios should be possible if you can establish a connection.
Examples for code review on commits in a central git repository are github, gitlab, gerrit code review.
Will I be able to achieve all the desired Git functionalities from

no, this is a github API supporting the  proprietary Github REST API which isn't supported by other git server implementations.
Typically such tasks are implemented on a local clone of the repository you are interested in. Since  git is a distributed and not
a centralized versioning system.  If you want to do this in Java use JGit.


Back to the top