Subject: [PATCH 0/2] builtin/sparse-checkout: add check-rules command

From: "William Sprent via GitGitGadget" <[email-masked]>
Date: Wed, 08 Mar 2023 13:49:07 +0000

Hi

Back in January I submitted a patch which suggested to teach 'ls-tree' to be
able to filter its output based on sparse checkout specifications [1]. My
main motivation for doing so was (is) to enable building more tooling on top
of sparse checkouts, which is currently hampered a bit by the fact that git
doesn't expose the pattern matching rules for the sparse checkouts.

I think the main point from that thread was that the 'ls-tree' change was
conceptually a larger change that I had initially thought it was. It was
suggested that perhaps it would be more straight-forward to initially add a
command in the vein of 'git-check-ignore' before teaching all the other
commands about sparse checkout specifics, and I think that makes sense. So I
am proposing here a new 'check-rules' sub-command to 'sparse-checkout'. This
exposes the sparse checkout pattern matching logic while still keeping the
pattern specification local to the sparse-checkout command.

Since the intention is that this new behavior would not need a work tree as
it allows the user to supply a set of rules to verify the paths against, the
change that introduces the sub-command is preceded by one that removes the
'NEEDS_WORK_TREE' flag for 'sparse-checkout' and replaces it with calls to
'setup_work_tree()' to keep current behavior.

1:
https://public-inbox.org/git/[email-masked]/

William Sprent (2):
  builtin/sparse-checkout: remove NEED_WORK_TREE flag
  builtin/sparse-checkout: add check-rules command

 Documentation/git-sparse-checkout.txt |  23 +++-
 builtin/sparse-checkout.c             | 132 +++++++++++++++++----
 git.c                                 |   2 +-
 t/t1091-sparse-checkout-builtin.sh    | 162 +++++++++++++++++++++++++-
 4 files changed, 295 insertions(+), 24 deletions(-)

base-commit: d15644fe0226af7ffc874572d968598564a230dd
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1488%2Fwilliams-unity%2Fsparse-doodle-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1488/williams-unity/sparse-doodle-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/1488
-- 
gitgitgadget