Duy Nguyen wrote:
> On Mon, Apr 1, 2013 at 11:48 AM, Jonathan Nieder <[email protected]> wrote:
>> I'm afraid I can't imagine when --no-respect-skip-worktree would be
>> useful. That can easily be a failure of my imagination, though.
>
> There may be scripts that expect "git checkout -- foo" to reset
> everything in "foo". Or maybe you just want to check out a single file
> and do not bother to edit sparse patterns as you won't need it for
> long.
Those scripts are bringing suffering on themselves by using porcelain
instead of "git checkout-index". The usual way to look at a single
file from the index is "git show :git.c >git.c".
So you've convinced me. I think --respect-skip-worktree can be just
the normal behavior (and that there's no need for a --no-respect
option). That would let me do:
git clone --no-checkout git://repo.or.cz/git.git
cd git
echo '/Documentation/' >.git/info/sparse-checkout
git config core.sparsecheckout true
git checkout
printf '%s\n' /README /INSTALL /COPYING >>.git/info/sparse-checkout
git checkout
... hack hack hack ...
# return to what the index has
git checkout .
without having to see any pesky actual source (*.c) files.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html