0

I am trying to write a java program that should analyse at runtime Log history information of any <<input>> given Git Repository (grab authors, date, path of files, modifications and actions on these files such as Modify Add Delete etc...). But I'm figuring out one main issue :

1: Is it possible to directly execute git commands from my java code maybe using some libraries that will avoid me first need to Clone the repository and execute a git log...?? (a kind of svnKit library for GIT ? )

Note the main goal at the end of this process is to have these Log history informations in a Xml output file - Any library to achieve this ? - Or i would need to parse and build on my own the xml file..?

1 Answer 1

2

You can use JGit; however, JGit will still need to be told to clone the repository.


If you just want the history of a repository as a single file, there is a standard for this, and it's called the git-fast-import file format. You can produce a git-fast-import file for a git repository using the command git fast-export.

Sign up to request clarification or add additional context in comments.

2 Comments

i'm trying to figure out how to call this git fast-export. should i first have to install JGit ? or i can call it without ? can you please provide me a short example assuming for example that i whant to fetch info from code.google.com/p/gitblit Thanks in advance..
git fast-export is part of the Git suite; it is nothing to do with JGit. So yes, you can call it without it. To do it in Java you can use ProcessBuilder; alternatively, to do it in a bash shell script you can just write git clone repository-url ; cd repository ; git fast-export

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.