{"thread":{"id":"39314","subject":"\"not in cache\" error from `git ls-files -m | git checkout-index -f --stdin` ?","startedAt":"2015-05-12T21:47:04Z","lastAt":"2015-05-12T21:47:04Z","messageCount":1,"participants":["Jim Hill"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"261091","messageId":"20150512214704.GA25107@gadabout.domain.actdsltmp","threadId":"39314","inReplyTo":null,"subject":"\"not in cache\" error from `git ls-files -m | git checkout-index -f --stdin` ?","fromName":"Jim Hill","fromEmail":"gjthill@gmail.com","sentAt":"2015-05-12T21:47:04Z","receivedAt":"2015-05-12T21:47:04Z","isPatch":false,"sender":{"key":"gjthill@gmail.com","avatar":"https://avatars.githubusercontent.com/u/80352?v=4"},"body":"Hi, it seems to me that in this sequence:\n\n    git ls-files -m | git checkout-index --stdin -m\n\nc-i should never complain that a file isn't in the cache, but that's\nexactly what this script produces for me:\n\n-8<----------\n\n#!/bin/sh\nrm -rf reproduce-c-i-weirdity\ngit init --template= reproduce-c-i-weirdity\ncd reproduce-c-i-weirdity\n\nmkdir content\nmkdir deployment\n\necho '*/' >>.gitignore\necho '!content/' >>.gitignore\n\necho deployme >>content/deployme\n\ngit add .\ngit commit -m-\n\ngit init --template= --bare test.git\ngit remote add test $PWD/test.git\n\nmkdir test.git/hooks\ncat >test.git/hooks/pre-receive <<\\EOD\n#!/bin/sh -x\nwhile read old new ref; do [[ $ref = refs/heads/master ]] && {\n\texport GIT_WORK_TREE=../deployment\n\texport GIT_INDEX_FILE=deployment-manifest\n\tgit read-tree -um `git write-tree` $new:content \\\n\t|| { git ls-files -m | tee /dev/stderr | git checkout-index -f --stdin;\n\t\tgit read-tree -um `git write-tree` $new:content; } \\\n\t|| exit $?\n}\ndone\nEOD\nchmod +x test.git/hooks/pre-receive\n\ngit push test master\n\necho nonono > deployment/deployme\necho yesyes > content/deployme\n\ngit commit -am-\ngit push test master\n\n->8-------------------\n\nread-tree and ls-files can both find the file and see that it's changed,\nso why not checkout-index?\n"}]}