{"thread":{"id":"47720","subject":"Re: Creating sparse checkout in a new linked git worktree","startedAt":"2018-01-30T14:25:31Z","lastAt":"2018-01-31T10:04:21Z","messageCount":3,"participants":["Jessie Hernandez","Eric Sunshine"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"337786","messageId":"615c04025165d0dff9d6e6b66bf11a41.squirrel@mail.jessiehernandez.com","threadId":"47720","inReplyTo":null,"subject":"Re: Creating sparse checkout in a new linked git worktree","fromName":"Jessie Hernandez","fromEmail":"git@jessiehernandez.com","sentAt":"2018-01-30T14:25:04Z","receivedAt":"2018-01-30T14:25:31Z","isPatch":false,"sender":{"key":"git@jessiehernandez.com","avatar":null},"body":"> On Wed, Jan 24, 2018 at 11:11 AM, Jessie Hernandez\n> <git@jessiehernandez.com> wrote:\n>> I am trying to get a sparse checkout in a linked worktree but cannot\nget\n>> it working. I have tried the following\n>> * git worktree add /some/new/path/new-branch --no-checkout\n>> * git config core.sparseCheckout true\n>> * <add the directory I would like to checkout out to\n>> $GIT_DIR/info/sparse-checkout>\n>> * cd  /some/new/path/new-branch\n>> * git read-tree -mu sparse-checkout\n>> But I still end up with a fully populated worktree.\n>> Is there something I am missing or doing wrong?\n> The sparse-checkout file is specific to each worktree, which allows you\nto control \"sparsity\" on a worktree by worktree basis. Therefore, you\nshould create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead\n(where <id> is \"new-branch\" in your example).\n\nRight this seems to work indeed.\nThank you.\n\nWould it help if this was added to the documentation of git-read-tree\n\nRegards,\nJessie\n\n\n\n\n"},{"id":"337797","messageId":"CAPig+cRiyterpyJfayVmA5Ra_zzyVp6GGSNqe2Tx-Hrrif+U8A@mail.gmail.com","threadId":"47720","inReplyTo":"615c04025165d0dff9d6e6b66bf11a41.squirrel@mail.jessiehernandez.com","subject":"Re: Creating sparse checkout in a new linked git worktree","fromName":"Eric Sunshine","fromEmail":"sunshine@sunshineco.com","sentAt":"2018-01-30T19:00:48Z","receivedAt":"2018-01-30T19:00:54Z","isPatch":false,"sender":{"key":"sunshine@sunshineco.com","avatar":"https://avatars.githubusercontent.com/u/163641?v=4"},"body":"On Tue, Jan 30, 2018 at 9:25 AM, Jessie Hernandez\n<git@jessiehernandez.com> wrote:\n>> The sparse-checkout file is specific to each worktree, which allows you\n> to control \"sparsity\" on a worktree by worktree basis. Therefore, you\n> should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead\n> (where <id> is \"new-branch\" in your example).\n>\n> Would it help if this was added to the documentation of git-read-tree\n\nIt probably would. Would you be interested in submitting a patch\n(mentioning 'git rev-parse --git-path info/sparse-checkout', as\nsuggested by Duy)?\n"},{"id":"337907","messageId":"cb45d936ebc51f852ec50baf9d5e89a3.squirrel@mail.jessiehernandez.com","threadId":"47720","inReplyTo":"CAPig+cRiyterpyJfayVmA5Ra_zzyVp6GGSNqe2Tx-Hrrif+U8A@mail.gmail.com","subject":"Re: Creating sparse checkout in a new linked git worktree","fromName":"Jessie Hernandez","fromEmail":"git@jessiehernandez.com","sentAt":"2018-01-31T10:03:43Z","receivedAt":"2018-01-31T10:04:21Z","isPatch":false,"sender":{"key":"git@jessiehernandez.com","avatar":null},"body":"> On Tue, Jan 30, 2018 at 9:25 AM, Jessie Hernandez\n> <git@jessiehernandez.com> wrote:\n>>> The sparse-checkout file is specific to each worktree, which allows you\n>> to control \"sparsity\" on a worktree by worktree basis. Therefore, you\n>> should create $GIT_DIR/worktrees/<id>/info/sparse-checkout instead\n>> (where <id> is \"new-branch\" in your example).\n>>\n>> Would it help if this was added to the documentation of git-read-tree\n>\n> It probably would. Would you be interested in submitting a patch\n> (mentioning 'git rev-parse --git-path info/sparse-checkout', as\n> suggested by Duy)?\n>\nSure. I will give it a try.\n\n"}]}