Re: [PATCH v2] checkout: add --no-widen for restoring files in sparse checkout mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Duy Nguyen wrote:
> On Mon, Apr 1, 2013 at 11:48 AM, Jonathan Nieder <jrnieder@xxxxxxxxx> 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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]