Skip to main content

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

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