From: Jim Hill <gjthill@gmail.com>
To: Git List <git@vger.kernel.org>
Subject: "not in cache" error from `git ls-files -m | git checkout-index -f --stdin` ?
Date: Tue, 12 May 2015 14:47:04 -0700 [thread overview]
Message-ID: <20150512214704.GA25107@gadabout.domain.actdsltmp> (raw)
Hi, it seems to me that in this sequence:
git ls-files -m | git checkout-index --stdin -m
c-i should never complain that a file isn't in the cache, but that's
exactly what this script produces for me:
-8<----------
#!/bin/sh
rm -rf reproduce-c-i-weirdity
git init --template= reproduce-c-i-weirdity
cd reproduce-c-i-weirdity
mkdir content
mkdir deployment
echo '*/' >>.gitignore
echo '!content/' >>.gitignore
echo deployme >>content/deployme
git add .
git commit -m-
git init --template= --bare test.git
git remote add test $PWD/test.git
mkdir test.git/hooks
cat >test.git/hooks/pre-receive <<\EOD
#!/bin/sh -x
while read old new ref; do [[ $ref = refs/heads/master ]] && {
export GIT_WORK_TREE=../deployment
export GIT_INDEX_FILE=deployment-manifest
git read-tree -um `git write-tree` $new:content \
|| { git ls-files -m | tee /dev/stderr | git checkout-index -f --stdin;
git read-tree -um `git write-tree` $new:content; } \
|| exit $?
}
done
EOD
chmod +x test.git/hooks/pre-receive
git push test master
echo nonono > deployment/deployme
echo yesyes > content/deployme
git commit -am-
git push test master
->8-------------------
read-tree and ls-files can both find the file and see that it's changed,
so why not checkout-index?
reply other threads:[~2015-05-12 21:47 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150512214704.GA25107@gadabout.domain.actdsltmp \
--to=gjthill@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox