Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Modification status

Hi Chris.

See my repo at https://github.com/alex73/trans. I made tests on the master==cb073c84ff70f690e2811ffc748df4d3dc4a1588.

alex@d:~/om3/t1$ ./org.eclipse.jgit.pgm-3.5.1.201410131835-r.sh debug-show-dir-cache
100644     77 2014-10-28,06:35:47.000 381fd17ed31490ca7603a2849f9e969dd29cfb3d 0    compiled/1.txt
100644  68868 2014-10-28,06:35:47.000 27fbd2d93d47fed96b00982072fa2cc6b265ec91 0    compiled/Bundle_be.properties
100644  69790 2014-10-28,06:35:47.000 2ee9a811ccd038f37763581113b9b3ac67966fb8 0    compiled/org/omegat/Bundle_be.properties
100644    631 2014-10-30,06:51:31.000 df3a2a85b3f311e0ae7958880319c2ee90a2c367 0    omegat.project
100644      0 2014-10-29,07:52:38.203 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0    omegat/ignored_words.txt
100644      0 2014-10-29,07:52:38.203 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 0    omegat/learned_words.txt
100644    861 2014-10-30,06:51:31.000 5b9fa1d37fbeda44c3515db9700ab03f7ed2d023 0    omegat/project_save.tmx
100644   9992 2014-10-28,06:35:47.000 f415a6ad1180a7934294026f3ab26f8f434cb098 0    reki.tmx
100644     25 2014-10-28,06:35:47.000 b7e50185defb84dfdbc7f87fccc772b70436ca3b 0    source/1.properties
100644     77 2014-10-28,06:35:47.000 381fd17ed31490ca7603a2849f9e969dd29cfb3d 0    t2/1.txt
100644     25 2014-10-28,06:35:47.000 b7e50185defb84dfdbc7f87fccc772b70436ca3b 0    t2/1_be.properties
100644  68889 2014-10-28,06:35:47.000 966a7b4c7bd86b99393ee425b508ac10fd068038 0    t2/Bundle_be.properties
100644  69811 2014-10-28,06:35:47.000 7af3559dc4d2e4ea6fbce4c8abbdfd95fd70dd20 0    t2/org/omegat/Bundle_be.properties
100644     77 2014-10-28,06:35:47.000 381fd17ed31490ca7603a2849f9e969dd29cfb3d 0    target/1.txt
100644     25 2014-10-28,06:35:47.000 b7e50185defb84dfdbc7f87fccc772b70436ca3b 0    target/1_be.properties
100644  68889 2014-10-28,06:35:47.000 966a7b4c7bd86b99393ee425b508ac10fd068038 0    target/Bundle_be.properties
100644  69811 2014-10-28,06:35:47.000 7af3559dc4d2e4ea6fbce4c8abbdfd95fd70dd20 0    target/org/omegat/Bundle_be.properties


alex@d:~/om3/t1$ git config -l
gui.spellingdictionary=none
push.default=simple
user.email=alex73mail@xxxxxxxxx
user.name=Aleś Bułojčyk
color.ui=auto
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.autocrlf=false
remote.origin.url="">remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
gui.wmstate=normal
gui.geometry=1920x1001+0+25 507 692

There is no .gitattributes.

Could it be side effects of the my using of working tree ? My software usually creates file omegat/project_save.tmx.new(untracked), then call some checkouts, delete branches, etc, then renames omegat/project_save.tmx.new into omegat/project_save.tmx(tracked). So, jgit can already saw file with the same length/date/sha1, but for other filename. Or even for omegat/project_save.tmx filename before some operations. And working tree contains untracked file with committed version of omegat/project_save.tmx but with other name(.bak).

My working copy diff:
       </tuv>
-      <tuv lang="be" changeid="Aleś Bułojčyk" changedate="20141029T032910Z" creationid="Aleś Bułojčyk" creationdate="20141028T041213Z">
-        <seg>1111</seg>
+      <tuv lang="be" changeid="Aleś Bułojčyk" changedate="20141030T035118Z" creationid="Aleś Bułojčyk" creationdate="20141028T041213Z">
+        <seg>5555</seg>
       </tuv>

I investigated a little bit: treeWalk.next() doesn't return omegat/project_save.tmx because IndexDiffFilter.include() returns false after :
        // Only one chance left to detect a diff: between index and working
        // tree. Make use of the WorkingTreeIterator#isModified() method to
        // avoid computing SHA1 on filesystem content if not really needed.
        return wi.isModified(di.getDirCacheEntry(), true, tw.getObjectReader());

So, looks like my software need to force SHA1 comparison.

WBR, Alex.

On 29 October 2014 09:04, Christian Halstrick <christian.halstrick@xxxxxxxxx> wrote:
That's strange. I never saw this.

Regarding cache: Yes, there is a cache. It called "the git index" :-).
But there is nothing what you expect, a in memory cache of file
content/metadata. IndexDiff will compare the files modification date
and length to what is "cached" in git's index. If both are the same
(and if the file is not "racily clean / smudged") then git will think
the file does not differ to what we have in index.

Can you share the repo?
Can you attach the output of the following command executed in your
repo: "org.eclipse.jgit.pgm-3.5.1.201410131835-r.sh
debug-show-dir-cache"
Can you attach the output of the following command executed in your
repo: "git config -l" (Be careful not to expose secret data here and
delete passwords etc)
Does your repo contain .gitattributes?


Back to the top