Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Quick question about WorkingTreeIterator::contentCheck

On 10 Mar 2020, at 18:39 , Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
> 
>> On Tue, Mar 10, 2020 at 5:51 PM Peter Hull <peterhull90@xxxxxxxxx> wrote:
>> The background is: Netbeans (11.3 on Windows) is showing
>> some files as modified in the IDE but neither 'Show diff' nor git from
>> the command line says they are modified. I traced through the NB code
>> as far as the point where it calls into jgit and it seems to be that
>> FileTreeIterator::isModified(entry, true, reader) was returning true
>> when the files were not modified.
>> 
> this should not happen, JGit first compares file meta data to detect modification (since that's faster),
> if this fails it compares the actual file content by comparing objectIDs (hash over the object's content).
> I guess you meant WorkingTreeIterator#isModified

Which JGit version? I have a hard time figuring this out, but
https://cwiki.apache.org/confluence/display/NETBEANS/Apache+NetBeans+11.3 mentions
https://issues.apache.org/jira/browse/NETBEANS-519, and the last PR there is
https://github.com/apache/netbeans/pull/1528. That updated JGit to 5.5.0.

That JGit version had a problem with different timestamp resolution between the git
index and the filesystem. The bug was fixed in JGit 5.5.1. If you can, try updating
to 5.5.1.

Otherwise, perhaps it's line endings. Check that the files do not use mixed line endings,
and double-check your autoCrlf and other git config settings and .gitattributes related
to line endings.

Cheers,

  Thomas

Back to the top