* Creating sparse checkout in a new linked git worktree
@ 2018-01-24 16:11 Jessie Hernandez
2018-01-28 7:25 ` Eric Sunshine
0 siblings, 1 reply; 6+ messages in thread
From: Jessie Hernandez @ 2018-01-24 16:11 UTC (permalink / raw)
To: git
Hi All,
I am trying to get a sparse checkout in a linked worktree but cannot get
it working. I have tried the following
* git worktree add /some/new/path/new-branch --no-checkout
* git config core.sparseCheckout true
* <add the directory I would like to checkout out to
$GIT_DIR/info/sparse-checkout>
* cd /some/new/path/new-branch
* git read-tree -mu sparse-checkout
But I still end up with a fully populated worktree.
Is there something I am missing or doing wrong?
thank you for any response.
jessie
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating sparse checkout in a new linked git worktree
2018-01-24 16:11 Creating sparse checkout in a new linked git worktree Jessie Hernandez
@ 2018-01-28 7:25 ` Eric Sunshine
2018-01-28 9:40 ` Duy Nguyen
0 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2018-01-28 7:25 UTC (permalink / raw)
To: git; +Cc: Git List
On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez
<git@jessiehernandez.com> wrote:
> I am trying to get a sparse checkout in a linked worktree but cannot get
> it working. I have tried the following
>
> * git worktree add /some/new/path/new-branch --no-checkout
> * git config core.sparseCheckout true
> * <add the directory I would like to checkout out to
> $GIT_DIR/info/sparse-checkout>
> * cd /some/new/path/new-branch
> * git read-tree -mu sparse-checkout
>
> But I still end up with a fully populated worktree.
> Is there something I am missing or doing wrong?
The sparse-checkout file is specific to each worktree, which allows
you to control "sparsity" on a worktree by worktree basis. Therefore,
you should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
(where <id> is "new-branch" in your example).
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating sparse checkout in a new linked git worktree
2018-01-28 7:25 ` Eric Sunshine
@ 2018-01-28 9:40 ` Duy Nguyen
0 siblings, 0 replies; 6+ messages in thread
From: Duy Nguyen @ 2018-01-28 9:40 UTC (permalink / raw)
To: Eric Sunshine; +Cc: git, Git List
On Sun, Jan 28, 2018 at 2:25 PM, Eric Sunshine <sunshine@sunshineco.com> wrote:
> On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez
> <git@jessiehernandez.com> wrote:
>> I am trying to get a sparse checkout in a linked worktree but cannot get
>> it working. I have tried the following
>>
>> * git worktree add /some/new/path/new-branch --no-checkout
>> * git config core.sparseCheckout true
>> * <add the directory I would like to checkout out to
>> $GIT_DIR/info/sparse-checkout>
>> * cd /some/new/path/new-branch
>> * git read-tree -mu sparse-checkout
>>
>> But I still end up with a fully populated worktree.
>> Is there something I am missing or doing wrong?
>
> The sparse-checkout file is specific to each worktree, which allows
> you to control "sparsity" on a worktree by worktree basis. Therefore,
> you should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
> (where <id> is "new-branch" in your example).
Nit. Do
$EDITOR `git rev-parse --git-path info/sparse-checkout`
if you're already in the right worktree so you don't have to find out
about <id> or the full path.
I wanted to add "git checkout --edit-sparse" for some time. Using it
in multiple worktrees may be a good push for me to eventually do it.
--
Duy
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating sparse checkout in a new linked git worktree
2018-01-30 19:00 ` Eric Sunshine
@ 2018-01-31 10:03 ` Jessie Hernandez
0 siblings, 0 replies; 6+ messages in thread
From: Jessie Hernandez @ 2018-01-31 10:03 UTC (permalink / raw)
To: Eric Sunshine; +Cc: git, git, Git List
> On Tue, Jan 30, 2018 at 9:25 AM, Jessie Hernandez
> <git@jessiehernandez.com> wrote:
>>> The sparse-checkout file is specific to each worktree, which allows you
>> to control "sparsity" on a worktree by worktree basis. Therefore, you
>> should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
>> (where <id> is "new-branch" in your example).
>>
>> Would it help if this was added to the documentation of git-read-tree
>
> It probably would. Would you be interested in submitting a patch
> (mentioning 'git rev-parse --git-path info/sparse-checkout', as
> suggested by Duy)?
>
Sure. I will give it a try.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating sparse checkout in a new linked git worktree
2018-01-30 14:25 Jessie Hernandez
@ 2018-01-30 19:00 ` Eric Sunshine
2018-01-31 10:03 ` Jessie Hernandez
0 siblings, 1 reply; 6+ messages in thread
From: Eric Sunshine @ 2018-01-30 19:00 UTC (permalink / raw)
To: git; +Cc: git, Git List
On Tue, Jan 30, 2018 at 9:25 AM, Jessie Hernandez
<git@jessiehernandez.com> wrote:
>> The sparse-checkout file is specific to each worktree, which allows you
> to control "sparsity" on a worktree by worktree basis. Therefore, you
> should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
> (where <id> is "new-branch" in your example).
>
> Would it help if this was added to the documentation of git-read-tree
It probably would. Would you be interested in submitting a patch
(mentioning 'git rev-parse --git-path info/sparse-checkout', as
suggested by Duy)?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Creating sparse checkout in a new linked git worktree
@ 2018-01-30 14:25 Jessie Hernandez
2018-01-30 19:00 ` Eric Sunshine
0 siblings, 1 reply; 6+ messages in thread
From: Jessie Hernandez @ 2018-01-30 14:25 UTC (permalink / raw)
To: Eric Sunshine; +Cc: git, Git List
> On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez
> <git@jessiehernandez.com> wrote:
>> I am trying to get a sparse checkout in a linked worktree but cannot
get
>> it working. I have tried the following
>> * git worktree add /some/new/path/new-branch --no-checkout
>> * git config core.sparseCheckout true
>> * <add the directory I would like to checkout out to
>> $GIT_DIR/info/sparse-checkout>
>> * cd /some/new/path/new-branch
>> * git read-tree -mu sparse-checkout
>> But I still end up with a fully populated worktree.
>> Is there something I am missing or doing wrong?
> The sparse-checkout file is specific to each worktree, which allows you
to control "sparsity" on a worktree by worktree basis. Therefore, you
should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead
(where <id> is "new-branch" in your example).
Right this seems to work indeed.
Thank you.
Would it help if this was added to the documentation of git-read-tree
Regards,
Jessie
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-01-31 10:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-24 16:11 Creating sparse checkout in a new linked git worktree Jessie Hernandez
2018-01-28 7:25 ` Eric Sunshine
2018-01-28 9:40 ` Duy Nguyen
2018-01-30 14:25 Jessie Hernandez
2018-01-30 19:00 ` Eric Sunshine
2018-01-31 10:03 ` Jessie Hernandez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).