git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Newbie questions regarding jgit

From
Jonas Fonseca <jonas.fonseca@gmail.com>
Date
Nov 11, 2008, 21:37 UTC
Message-ID
<2c6b72b30811111337v2fe23c75v25251838f721a007@mail.gmail.com>
In-Reply-To
<4919EECB.7070408@wellfleetsoftware.com>

On Tue, Nov 11, 2008 at 21:44, Farrukh Najmi <farrukh@wellfleetsoftware.com> wrote:

> Hi all,
Hello,
> I am git newbie and looking to use jgit in a servlet endpoint.

Sounds interesting. I have been thinking about how hard it would be to write a very simpe jgitweb kind of thing and am very interested to hear more about your experiences.

> Where can I find a public maven repo for gjit? It seems there is one
> somewhere because of the following file in src tree:

I would also like to have a public available maven repository for JGit. If Shawn or Robin acks, I can look into hosting one in the SVN area of the Google Code project page. Given the lack of a real release cycle it probably only makes sense to have a snapshot repository.

Show 7 quoted lines
> Now I am wondering where to begin to learn how to do the equivalent of the
> following commands via the gjit Java API:
>
>   * git add /file/
>   * git rm /file/
>   * git mv /file
>   * Whatever is the git way to get a specific version of a file

JGit currently has two APIs for working with the index, which will allow you to add, remove and move data around in the tree. In nbgit I ended up using GitIndex, which I found easier to figure out. As I understand it, in the long run you want to use the DirCache API, but it is still a work in progress.

> I am hoping that there aremore docs, samples, tutorials etc. somewhere that
> I am missing. Thanks for any help you can provide. Some pointers or code
> fragments would be terrific.

I started working on a tutorial for JGit, but didn't get very far so it mostly consists of stub pages.

 - http://code.google.com/docreader/#p=egit&s=egit&t=JGitTutorial

I have been working on moving the tutorial to maven project before starting to write the more code heavy topics. This would make it possible to include code snippets in the tutorial, while also allowing to compile and test the examples.

-- 
Jonas Fonseca
Previous: Farrukh NajmiNext: Shawn O. Pearce
Message 3 of 16 in “Newbie questions regarding jgit”
  1. Farrukh NajmiNov 11, 2008
  2. Farrukh NajmiNov 11, 2008
  3. Jonas FonsecaNov 11, 2008
  4. Shawn O. PearceNov 11, 2008
  5. Jonas FonsecaNov 11, 2008
  6. Shawn O. PearceNov 11, 2008
  7. Add maven distribution management info for the new snapshot repositoryJonas Fonseca, Nov 11, 2008
  8. Shawn O. PearceNov 12, 2008
  9. Shawn O. PearceNov 12, 2008
  10. Imran M YousufNov 12, 2008
  11. Farrukh NajmiNov 12, 2008
  12. Farrukh NajmiNov 12, 2008
  13. Farrukh NajmiNov 12, 2008
  14. Farrukh NajmiNov 12, 2008
  15. Jonas FonsecaNov 12, 2008
  16. Shawn O. PearceNov 12, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.