A leftover pdb.set_trace() that snuck into production is the exact reason we first added this :)
git checkout-index --prefix=../temp/ --all
work?
[snip]
> You seem to suggest that the index consists of only the files that were modified / added in the commit, which is not the case.
To see that the parent's parenthesis doesn't suggest that, consider that in Git you commit the state of the whole tree and not just the modified / added files. The Git manual puts it this way:
[git commit] Stores the current contents of the index in a new commit along with a log message from the user describing the changes.
EDIT: Sorry, now I see what you mean:
>> only copying whatever I'm about to commit
... while the code actually only copies those files that have changes about to be committed.
It just runs pyflakes and does some sanity checking. Best of all, it doesn't go around stashing files or otherwise messing with your working directory or repository. It just uses some git plumbing commands to copy the current index (what you're about to commit) to a temporary directory.
I can't remember where I copied it from but it works perfectly, only copying whatever I'm about to commit:
I can't say how many times this saved me from leaving a pdb.set_trace() in a view somewhere...