From: Junio C Hamano Date: Wed, 08 Mar 2023 18:14:04 GMT Subject: Re: [PATCH 1/2] builtin/sparse-checkout: remove NEED_WORK_TREE flag Message-ID: In-Reply-To: <4b231e9beb43e4fac6457b9bf86e4c1db39c4238.1678283349.git.gitgitgadget@gmail.com> "William Sprent via GitGitGadget" 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.