{"thread":{"id":"57626","subject":"Add a \"remove\" subcommand to \"git-sparse-checkout\"","startedAt":"2022-03-28T03:46:36Z","lastAt":"2022-03-28T13:11:18Z","messageCount":2,"participants":["Shaoxuan Yuan","Derrick Stolee"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"452449","messageId":"CAJyCBORyNQX7u5=ZTdyHWyb63r-Cus4hb_yZingm4B=J4pjhkA@mail.gmail.com","threadId":"57626","inReplyTo":null,"subject":"Add a \"remove\" subcommand to \"git-sparse-checkout\"","fromName":"Shaoxuan Yuan","fromEmail":"shaoxuan.yuan02@gmail.com","sentAt":"2022-03-28T03:46:20Z","receivedAt":"2022-03-28T03:46:36Z","isPatch":false,"sender":{"key":"shaoxuan.yuan02@gmail.com","avatar":"https://avatars.githubusercontent.com/u/46557895?v=4"},"body":"Hi all,\n\nI'm wondering do we have a plan to add a \"remove\" subcommand\nto the existing \"git-sparse-checkout\" command set?\n\nBecause when I am messing with sparse-checkout, I sometimes want\nto remove a directory from cone, and I have to either go into\n\".git/info/sparse-checkout\"\nto manually remove it, or \"disable\" then \"init\" or \"set\" the\ndirectories all over again.\n\nI think it will be nice to \"remove\" a directory, then \"reapply\" to get\nthe job done.\n\n-- \nThanks & Regards,\nShaoxuan\n"},{"id":"452466","messageId":"41050612-b5ba-c394-a288-000d5a49e51a@github.com","threadId":"57626","inReplyTo":"CAJyCBORyNQX7u5=ZTdyHWyb63r-Cus4hb_yZingm4B=J4pjhkA@mail.gmail.com","subject":"Re: Add a \"remove\" subcommand to \"git-sparse-checkout\"","fromName":"Derrick Stolee","fromEmail":"derrickstolee@github.com","sentAt":"2022-03-28T13:11:02Z","receivedAt":"2022-03-28T13:11:18Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 3/27/2022 11:46 PM, Shaoxuan Yuan wrote:\n> Hi all,\n> \n> I'm wondering do we have a plan to add a \"remove\" subcommand\n> to the existing \"git-sparse-checkout\" command set?\n> \n> Because when I am messing with sparse-checkout, I sometimes want\n> to remove a directory from cone, and I have to either go into\n> \".git/info/sparse-checkout\"\n> to manually remove it, or \"disable\" then \"init\" or \"set\" the\n> directories all over again.\n> \n> I think it will be nice to \"remove\" a directory, then \"reapply\" to get\n> the job done.\n \nThis is definitely something that can be done. I didn't include\nit in the original plan (it is a natural analogue to 'add') because\nof strange UX issues that arise when thinking about it a little\nwhile.\n\nImagine this sequence of events:\n\n\tgit sparse-checkout set A/B/C D/E\n\tgit sparse-checkout add A/B\n\tgit sparse-checkout remove A/B\n\nIn this sequence, A/B/C was declared as an important directory,\nbut then it gets removed from the sparse-checkout file because\nit becomes implies by A/B.\n\nWhen removing A/B, the most obvious implementation would remove\neverything under A/B. But, would a user expect to have Git\nremember A/B/C?\n\nThis is just a subtle point that has prevented me from building\nthe feature proactively. If someone else has a deeper need for\nthe feature, then choosing what works best for their expectations\n(with enough documentation to assist anyone with a different\nexpectation) would be sufficient.\n\nAlso, if you implement a 'git sparse-checkout remove', then I\ndo not anticipate a 'reapply' being necessary afterwards. It\nshould update the worktree before exiting.\n\nThanks,\n-Stolee\n"}]}