Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] JGit Client API

On Sun, Apr 18, 2010 at 16:13, Christian Halstrick
<christian.halstrick@xxxxxxxxx> wrote:
> And for me the next best alternative is option b) , the Builder
> proposal from Shawn.

I went with a builder API when I started to refactor the JGit code
used in the NetBeans plugin:

 - http://github.com/jonas/nbgit/tree/master/src/org/nbgit/client/

And it has worked quite nicely, especially to make tests readable. I
have a few requests for such an API. First, that there is some kind of
builder to manipulate the index. While the new DirCache API is
generally nice it is not as easy to use as the now deprecated
GitIndex. Second, it would be nice to also have a builder to generate
a tree diff of changed paths for status and commit visualization,
since it can be tricky wrt. comparing modes.

Finally, it is my impression that the JGit APIs generally try to avoid
direct use of java.util.File prefering instead strings containing
relative paths. NetBeans' VCS API makes extensive use of
java.util.File and it can be error-prone to convert paths, e.g. past
index out of bound exception in Repository.stripWorkDir(). At least,
it is my impression that I ended up having 3 duplicate methods doing
what Repository.stripWorkDir() did, before I found this method. I
don't know if this still goes for someone new to JGit, however, would
it be possible to have these builders take both?

-- 
Jonas Fonseca


Back to the top