From: Derrick Stolee <derrickstolee@github.com>
To: Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>,
Victoria Dye <vdye@github.com>,
Junio C Hamano <gitster@pobox.com>,
Git List <git@vger.kernel.org>, Elijah Newren <newren@gmail.com>
Subject: Re: Add a "remove" subcommand to "git-sparse-checkout"
Date: Mon, 28 Mar 2022 09:11:02 -0400 [thread overview]
Message-ID: <41050612-b5ba-c394-a288-000d5a49e51a@github.com> (raw)
In-Reply-To: <CAJyCBORyNQX7u5=ZTdyHWyb63r-Cus4hb_yZingm4B=J4pjhkA@mail.gmail.com>
On 3/27/2022 11:46 PM, Shaoxuan Yuan wrote:
> Hi all,
>
> I'm wondering do we have a plan to add a "remove" subcommand
> to the existing "git-sparse-checkout" command set?
>
> Because when I am messing with sparse-checkout, I sometimes want
> to remove a directory from cone, and I have to either go into
> ".git/info/sparse-checkout"
> to manually remove it, or "disable" then "init" or "set" the
> directories all over again.
>
> I think it will be nice to "remove" a directory, then "reapply" to get
> the job done.
This is definitely something that can be done. I didn't include
it in the original plan (it is a natural analogue to 'add') because
of strange UX issues that arise when thinking about it a little
while.
Imagine this sequence of events:
git sparse-checkout set A/B/C D/E
git sparse-checkout add A/B
git sparse-checkout remove A/B
In this sequence, A/B/C was declared as an important directory,
but then it gets removed from the sparse-checkout file because
it becomes implies by A/B.
When removing A/B, the most obvious implementation would remove
everything under A/B. But, would a user expect to have Git
remember A/B/C?
This is just a subtle point that has prevented me from building
the feature proactively. If someone else has a deeper need for
the feature, then choosing what works best for their expectations
(with enough documentation to assist anyone with a different
expectation) would be sufficient.
Also, if you implement a 'git sparse-checkout remove', then I
do not anticipate a 'reapply' being necessary afterwards. It
should update the worktree before exiting.
Thanks,
-Stolee
prev parent reply other threads:[~2022-03-28 13:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 3:46 Add a "remove" subcommand to "git-sparse-checkout" Shaoxuan Yuan
2022-03-28 13:11 ` Derrick Stolee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41050612-b5ba-c394-a288-000d5a49e51a@github.com \
--to=derrickstolee@github.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=newren@gmail.com \
--cc=shaoxuan.yuan02@gmail.com \
--cc=vdye@github.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).