{"thread":{"id":"40884","subject":"Sparse checkout in worktree","startedAt":"2015-11-25T12:40:09Z","lastAt":"2015-11-25T20:50:23Z","messageCount":6,"participants":["Michael J Gruber","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"273732","messageId":"5655AC29.20801@drmicha.warpmail.net","threadId":"40884","inReplyTo":null,"subject":"Sparse checkout in worktree","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2015-11-25T12:40:09Z","receivedAt":"2015-11-25T12:40:09Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Hi there,\n\nI'm wondering how much it would take to enable worktree specific sparse\ncheckouts. From a superfluous look:\n\n- $GIT_DIR/info/sparse_checkout needs to be worktree specific\n- We don't have much tooling around sparse to speak of at all.\n\nThe endgoal would be to have something like\n\ngit checkout [--sparse <pattern>]...\n\nwhich sets up the sparse_checkout file and \"git worktree\" to pass any\n--sparse option on to \"git checkout\".\n\nWhile in an ideal world we all have micro repos, in the real world we\noften have larger repos with mostly independent subdirs. For a quick fix\non a side branch in a subdir, a new sparse worktree would be an ideal\nlean solution.\n\nAs it is, \"git stash save && git checkout\" is leaner but interrupts the\nworkflow more, and a local \"git clone\" with links and alternates is\nleaner, too, but conceptually overkill if you want to work quickly on an\nexisting side branch.\n\nCheers,\nMichael\n"},{"id":"273754","messageId":"CACsJy8Acb0Z3sw7_r6QfTTz=GqedsU76QxjexWf4yZFg9O7W-w@mail.gmail.com","threadId":"40884","inReplyTo":"5655AC29.20801@drmicha.warpmail.net","subject":"Re: Sparse checkout in worktree","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-11-25T19:38:58Z","receivedAt":"2015-11-25T19:38:58Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 25, 2015 at 1:40 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Hi there,\n>\n> I'm wondering how much it would take to enable worktree specific sparse\n> checkouts. From a superfluous look:\n>\n> - $GIT_DIR/info/sparse_checkout needs to be worktree specific\n\nIt already is.\n\n> - We don't have much tooling around sparse to speak of at all.\n>\n> The endgoal would be to have something like\n>\n> git checkout [--sparse <pattern>]...\n>\n> which sets up the sparse_checkout file and \"git worktree\" to pass any\n> --sparse option on to \"git checkout\"\n\nOr.. convert pathspec specified at 'git-checkout' (or git-worktree)\ninto sparse patterns. For example,\n\ngit worktree add --sparse some-path branch --  foo/\n\nwill automatically create sparse-checkout file that limits to 'foo'.\nNot easy (and in some cases probably impossible), but it's more\nintuitive.\n.\n> While in an ideal world we all have micro repos, in the real world we\n> often have larger repos with mostly independent subdirs. For a quick fix\n> on a side branch in a subdir, a new sparse worktree would be an ideal\n> lean solution.\n\nSparse checkout should eventually be replaced with something better\nthat does not keep full tree in index, but I don't think anybody is\nworking on that..\n\n> As it is, \"git stash save && git checkout\" is leaner but interrupts the\n> workflow more, and a local \"git clone\" with links and alternates is\n> leaner, too, but conceptually overkill if you want to work quickly on an\n> existing side branch.\n--\nDuy\n"},{"id":"273756","messageId":"56560FAE.3000605@drmicha.warpmail.net","threadId":"40884","inReplyTo":"CACsJy8Acb0Z3sw7_r6QfTTz=GqedsU76QxjexWf4yZFg9O7W-w@mail.gmail.com","subject":"Re: Sparse checkout in worktree","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2015-11-25T19:44:46Z","receivedAt":"2015-11-25T19:44:46Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Duy Nguyen venit, vidit, dixit 25.11.2015 20:38:\n> On Wed, Nov 25, 2015 at 1:40 PM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Hi there,\n>>\n>> I'm wondering how much it would take to enable worktree specific sparse\n>> checkouts. From a superfluous look:\n>>\n>> - $GIT_DIR/info/sparse_checkout needs to be worktree specific\n> \n> It already is.\n\nBut where should I put the worktree specific sparse_checkout file? Is\nDocumentation/technical really the only place to find information about\nthis? And to make the existing tree sparse, do I need to rm -r and\ncheckout sparsely?\n\nMichael\n"},{"id":"273761","messageId":"CACsJy8BGPk7C3d9JWjRwYrgh4OTUiiAjGzcKcRJy8+-5=x8=Pg@mail.gmail.com","threadId":"40884","inReplyTo":"56560FAE.3000605@drmicha.warpmail.net","subject":"Re: Sparse checkout in worktree","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-11-25T20:17:56Z","receivedAt":"2015-11-25T20:17:56Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 25, 2015 at 8:44 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> Duy Nguyen venit, vidit, dixit 25.11.2015 20:38:\n>> On Wed, Nov 25, 2015 at 1:40 PM, Michael J Gruber\n>> <git@drmicha.warpmail.net> wrote:\n>>> Hi there,\n>>>\n>>> I'm wondering how much it would take to enable worktree specific sparse\n>>> checkouts. From a superfluous look:\n>>>\n>>> - $GIT_DIR/info/sparse_checkout needs to be worktree specific\n>>\n>> It already is.\n>\n> But where should I put the worktree specific sparse_checkout file? Is\n> Documentation/technical really the only place to find information about\n> this? And to make the existing tree sparse, do I need to rm -r and\n> checkout sparsely?\n\nAhh.. worktree-specific files of the checkout \"foo\" stay in\n$GIT_DIR/repos/foo. So sparse-checkout path should be\n$GIT_DIR/repos/foo/info/sparse-checkout. This is another good reason\nto add 'git checkout --edit-sparse' that opens the sparse-checkout\nfile for you to update. Or you could use 'git rev-parse --git-path\ninfo/sparse-checkout\" to get full path.\n-- \nDuy\n"},{"id":"273766","messageId":"56561D94.7020503@drmicha.warpmail.net","threadId":"40884","inReplyTo":"CACsJy8BGPk7C3d9JWjRwYrgh4OTUiiAjGzcKcRJy8+-5=x8=Pg@mail.gmail.com","subject":"Re: Sparse checkout in worktree","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2015-11-25T20:44:04Z","receivedAt":"2015-11-25T20:44:04Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Duy Nguyen venit, vidit, dixit 25.11.2015 21:17:\n> On Wed, Nov 25, 2015 at 8:44 PM, Michael J Gruber\n> <git@drmicha.warpmail.net> wrote:\n>> Duy Nguyen venit, vidit, dixit 25.11.2015 20:38:\n>>> On Wed, Nov 25, 2015 at 1:40 PM, Michael J Gruber\n>>> <git@drmicha.warpmail.net> wrote:\n>>>> Hi there,\n>>>>\n>>>> I'm wondering how much it would take to enable worktree specific sparse\n>>>> checkouts. From a superfluous look:\n>>>>\n>>>> - $GIT_DIR/info/sparse_checkout needs to be worktree specific\n>>>\n>>> It already is.\n>>\n>> But where should I put the worktree specific sparse_checkout file? Is\n>> Documentation/technical really the only place to find information about\n>> this? And to make the existing tree sparse, do I need to rm -r and\n>> checkout sparsely?\n> \n> Ahh.. worktree-specific files of the checkout \"foo\" stay in\n> $GIT_DIR/repos/foo. So sparse-checkout path should be\n> $GIT_DIR/repos/foo/info/sparse-checkout. This is another good reason\n> to add 'git checkout --edit-sparse' that opens the sparse-checkout\n> file for you to update. Or you could use 'git rev-parse --git-path\n> info/sparse-checkout\" to get full path.\n> \n\n[ \"worktrees\", not \"repos\" ]\n\nMaybe creating an empty info dir by default would help already - I had\nlooked in there but didn't find anything.\n\nOTOH, config is common: core.sparseCheckout\nSo, the per worktree \"switch\" is the presence of the sparse-checkout file.\n\nMichael\n"},{"id":"273767","messageId":"CACsJy8ALKZqY++gmabZ-GKvrxkTGAq1=yMQh9EApMs3yhUiK=g@mail.gmail.com","threadId":"40884","inReplyTo":"56561D94.7020503@drmicha.warpmail.net","subject":"Re: Sparse checkout in worktree","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2015-11-25T20:50:23Z","receivedAt":"2015-11-25T20:50:23Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Wed, Nov 25, 2015 at 9:44 PM, Michael J Gruber\n<git@drmicha.warpmail.net> wrote:\n> OTOH, config is common: core.sparseCheckout\n> So, the per worktree \"switch\" is the presence of the sparse-checkout file.\n\nOh.. but yeah, splitting config file per worktree is on my todo list.\nOr you can help finish it [1] if you want to make it happen faster\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/266520\n-- \nDuy\n"}]}