Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Transient poopies after JGit commit

On Sat, Feb 20, 2010 at 2:53 AM, Bill Burdick <bill.burdick@xxxxxxxxx> wrote:
> I'm using JGit in my Xus project, which I talk about here:
> and I'm experiencing just a
> tiny bit of poop in my test Git directory.  To do the commit, I'm using code
> modified from egit and from a thread on the old list:
> After I run my code, when I open gitk in the git project directory in which
> I just committed, gitk says there are "Local uncommitted changes, not
> checked into index".  When I select that item in gitk, it displays a list of
> all of the files in the diff area, but there are no diff contents for any of
> the files; just an empty entry under each file name.  After I use git gui or
> git status and then reload or reopen gitk, the uncommitted changes item is
> no longer in the list.
> Is this normal behavior for JGit?  Here's the Scala script I'm using to test
> JGit (should be fairly easy to read for a Java person).

I think what is happening is the stat data for the files wasn't
properly updated into the index when the files were staged for commit.
 Its probably a bug in GitIndex, we aren't filling out the stat data
the way C git expects us to, resulting in C git thinking the file is

Actually, that could be caused by C git also using the dev and inode
inside of the stat record in the index, while JGit can't populate
those so it fills them in with 0.  IIRC more recent versions of C git
actually dropped filling those fields and also now zero fills them,
because NFS was causing similar problems when you unmount and remount
a filesystem the dev might change.

But aside from that, you probably want to be using DirCache in new
code, not GitIndex.  DirCache usually performs better, as it has a
lighter-weight read/write code path and sorts paths to perform a
merge-join during updates.  We're also trying to deprecate GitIndex
and switch entirely to DirCache at some point in the future.

Back to the top