Re: [PATCH v3 6/6] worktree: copy sparse-checkout patterns and config on add
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 30, 2021, 08:01 UTC
- Message-ID
- <CAPig+cSEbiLJ1yCCv_hsoWVgpXE13B9-UwWzi7jhWq4NgYc0Nw@mail.gmail.com>
- In-Reply-To
- <CABPp-BE9umOTkjfnB0X+9nTZaBmeXd4z5DmiZ1Upzds=m1spPw@mail.gmail.com>
On Wed, Dec 29, 2021 at 2:52 PM Elijah Newren <newren@gmail.com> wrote:
Show 14 quoted lines
> On Wed, Dec 29, 2021 at 9:31 AM Derrick Stolee <stolee@gmail.com> wrote: > > I'll wait for more feedback on the overall ideas (and names of things > > like the init-worktree-config subcommand). > > What value does the init-worktree-config subcommand provide; why > shouldn't we just get rid of it? > > I know Eric was strongly suggesting it, but he was thinking in terms > of always doing that full switchover step, or never doing it. Both > extremes had the potential to cause user-visible bugs, and thus he > suggested providing a command to allow users to pick their poison. I > provided a suggestion avoiding both extremes that doesn't have that > pick-your-poison approach, so I don't see why forcing users into this > extra step makes any sense.
Right. The minimally invasive, minimally dangerous approach you outlined at the very bottom of [1] obviates the need for `init-worktree-config`. We still want the underlying function for `git worktree add` to call, but a user-facing command providing the same functionality becomes much less meaningful since enabling per-worktree configuration involves no more than simply setting `extension.worktreeConfig=true` in all cases.
So, I can't think of any reason to add `init-worktree-config` presently (if ever).
[1]: https://lore.kernel.org/git/CABPp-BHuO3B366uJuODMQo-y449p8cAMVn0g2MTcO5di3Xa7Zg@mail.gmail.com/