Re: [PATCH 1/2] builtin/sparse-checkout: remove NEED_WORK_TREE flag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 8, 2023, 18:14 UTC
- Message-ID
- <xmqqmt4nt8k3.fsf@gitster.g>
- In-Reply-To
- <4b231e9beb43e4fac6457b9bf86e4c1db39c4238.1678283349.git.gitgitgadget@gmail.com>
"William Sprent via GitGitGadget" <gitgitgadget@gmail.com> writes:
> In preparation for adding a sub-command to 'sparse-checkout' that can be > run in a bare repository, remove the 'NEED_WORK_TREE' flag from its > entry in the 'commands' array of 'git.c'.
Given that "sparse-checkout" is about affecting which part of the directory hierarchies are to be materialized in the working tree, the idea to add a subcommand that does not require a working tree to the command by itself smells very iffy, and the changes necessary to protect the existing commands from the breakage caused by the decision to drop NEED_WORK_TREE bit, i.e. sprinkling many setup_work_tree() calls, somehow looks like they are solving a problem that did not have to get created in the first place.
But you did not find a place the feature you wanted to add with [2/2] would fit better, perhaps, in which case, somebody else may be able to suggest an alternative in their reviews of that step, hopefully.