{"thread":{"id":"22992","subject":"On refreshing the index","startedAt":"2010-03-11T18:19:35Z","lastAt":"2010-03-15T00:19:01Z","messageCount":3,"participants":["Sergio Callegari","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"136611","messageId":"loom.20100311T191149-453@post.gmane.org","threadId":"22992","inReplyTo":null,"subject":"On refreshing the index","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-03-11T18:19:35Z","receivedAt":"2010-03-11T18:19:35Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Hi,\n\nI have recently received instructions on how to refresh the index...\nHowever, it looks like I've run into a case where the refresh is not as\nsuccessful as expected...\n\nHere it is\n\nIf I run git status, git runs filters on a couple of opendocument files for\nwhich a filter is defined\n\nGIT_TRACE=1 git status\ntrace: built-in: git 'status'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n# On branch M05\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       WIP/\n#       program.txt\n#       program.txt~\nnothing added to commit but untracked files present (use \"git add\" to track)\n\n ... but there is actually nothing new...\n so I try to update the index\n\nGIT_TRACE=1 git update-index --refresh\ntrace: built-in: git 'update-index' '--refresh'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n\nIs now status any faster?\n\nGIT_TRACE=1 git status\ntrace: built-in: git 'status'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n# On branch M05\n# Untracked files:\n#   (use \"git add <file>...\" to include in what will be committed)\n#\n#       WIP/\n#       program.txt\n#       program.txt~\nnothing added to commit but untracked files present (use \"git add\" to track)\n\nNo, the filters are run all the same...\nWhat about git diff?\n\nGIT_TRACE=1 git diff\ntrace: built-in: git 'diff'\ntrace: run_command: 'less'\ntrace: exec: 'less'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\ntrace: run_command: 'rezip -p ODF_UNCOMPRESS2'\ntrace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n\n... really there is no change ...\nBut git keeps running the filters on these two files (note that there are other\nOO files in the repo, and with the others, the filters are not run).\n\nThis happened on 1.7.0.2 after switching branches.\n\nSergio\n"},{"id":"136739","messageId":"7vmxyb3la7.fsf@alter.siamese.dyndns.org","threadId":"22992","inReplyTo":"loom.20100311T191149-453@post.gmane.org","subject":"Re: On refreshing the index","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-13T22:32:32Z","receivedAt":"2010-03-13T22:32:32Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sergio Callegari <sergio.callegari@gmail.com> writes:\n\n> If I run git status, git runs filters on a couple of opendocument files for\n> which a filter is defined\n>\n> GIT_TRACE=1 git status\n> trace: built-in: git 'status'\n> trace: run_command: 'rezip -p ODF_UNCOMPRESS2'\n> trace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n> trace: run_command: 'rezip -p ODF_UNCOMPRESS2'\n> trace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n> # On branch M05\n> # Untracked files:\n> #   (use \"git add <file>...\" to include in what will be committed)\n> #\n> #       WIP/\n> #       program.txt\n> #       program.txt~\n> nothing added to commit but untracked files present (use \"git add\" to track)\n\nWhat does \"git diff-files\" and/or \"git diff-index HEAD\" say at this point?\nIf they do not say there are no difference, that means that the file on\nthe filesystem and the blob registered in the index are different, even\nthough after transmogrified with rezip (whatever it does) these two\ndifferent blobs may look the same.\n\n\"update-index --refresh\" marks index entries for paths whose files on the\nfilesystem are identical to the blobs registered for them in the index as\nup-to-date, so that later comparison do not have to inspect contents\n(instead, it can notice something has changed by looking at stat data such\nas file timestamps).\n\nI think the difference between \"may look the same\" and \"identical\" is what\nyou are seeing.  Try \"git add\" on those paths and see what happens.\n"},{"id":"136784","messageId":"4B9D7CF5.5010404@gmail.com","threadId":"22992","inReplyTo":"7vmxyb3la7.fsf@alter.siamese.dyndns.org","subject":"Re: On refreshing the index","fromName":"Sergio Callegari","fromEmail":"sergio.callegari@gmail.com","sentAt":"2010-03-15T00:19:01Z","receivedAt":"2010-03-15T00:19:01Z","isPatch":false,"sender":{"key":"sergio.callegari@gmail.com","avatar":"https://gravatar.com/avatar/c98f41317e0422c1e630385de0e3970227b8e5ad15f35ba8586066467cc833bc?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> Sergio Callegari <sergio.callegari@gmail.com> writes:\n>\n>   \n>> If I run git status, git runs filters on a couple of opendocument files for\n>> which a filter is defined\n>>\n>> GIT_TRACE=1 git status\n>> trace: built-in: git 'status'\n>> trace: run_command: 'rezip -p ODF_UNCOMPRESS2'\n>> trace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n>> trace: run_command: 'rezip -p ODF_UNCOMPRESS2'\n>> trace: exec: 'sh' '-c' 'rezip -p ODF_UNCOMPRESS2' 'rezip -p ODF_UNCOMPRESS2'\n>> # On branch M05\n>> # Untracked files:\n>> #   (use \"git add <file>...\" to include in what will be committed)\n>> #\n>> #       WIP/\n>> #       program.txt\n>> #       program.txt~\n>> nothing added to commit but untracked files present (use \"git add\" to track)\n>>     \n>\n> What does \"git diff-files\" and/or \"git diff-index HEAD\" say at this point?\n> If they do not say there are no difference, that means that the file on\n> the filesystem and the blob registered in the index are different, even\n> though after transmogrified with rezip (whatever it does) these two\n> different blobs may look the same.\n>   \nNeither git diff-files\" and/or \"git diff-index HEAD say nothing at this \npoint...\n\n> I think the difference between \"may look the same\" and \"identical\" is what\n> you are seeing.  Try \"git add\" on those paths and see what happens.\n>   \nIs there any way I can find out which file is the guilty one since git \ndiff-files says nothing? E.g. a trace telling me on what is the filter \nbeing called?\n\nBTW... some notes that may be useful...\n\n1) rezip is a mere recompressor.  It takes a zip file and re-creates it \nat zero compression, so that the git delta logic can do a good job on it \non repacking.  I've found this useful on zip files, openoffice files, \njar files, etc.\n\n2) if I clone outside git, git update-index --refresh is always ok at \nmaking git status fast (i.e. not running expensive filters).\n\n3) The problem always happens when I switch branches, right after the \nswitch.\n\nSergio\n"}]}