git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
William Sprent via GitGitGadget <gitgitgadget@gmail.com>
Date
Mar 8, 2023, 13:49 UTC
Message-ID
<pull.1488.git.1678283349.gitgitgadget@gmail.com>
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/pull.1459.git.1673456518993.gitgitgadget@gmail.com/

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
Next: William Sprent via GitGitGadget
Message 1 of 18 in “builtin/sparse-checkout: add check-rules command”
  1. 0/2 builtin/sparse-checkout: add check-rules commandWilliam Sprent via GitGitGadget, Mar 8, 2023
  2. 1/2 builtin/sparse-checkout: remove NEED_WORK_TREE flagWilliam Sprent via GitGitGadget, Mar 8, 2023
  3. Junio C HamanoMar 8, 2023
  4. Junio C HamanoMar 8, 2023
  5. Elijah NewrenMar 9, 2023
  6. Junio C HamanoMar 9, 2023
  7. 2/2 builtin/sparse-checkout: add check-rules commandWilliam Sprent via GitGitGadget, Mar 8, 2023
  8. Elijah NewrenMar 19, 2023
  9. William SprentMar 20, 2023
  10. Elijah NewrenMar 19, 2023
  11. 0/2 builtin/sparse-checkout: add check-rules commandWilliam Sprent via GitGitGadget, Mar 27, 2023
  12. 1/2 builtin/sparse-checkout: remove NEED_WORK_TREE flagWilliam Sprent via GitGitGadget, Mar 27, 2023
  13. Junio C HamanoMar 27, 2023
  14. SZEDER GáborApr 7, 2023
  15. Junio C HamanoApr 7, 2023
  16. 2/2 builtin/sparse-checkout: add check-rules commandWilliam Sprent via GitGitGadget, Mar 27, 2023
  17. Elijah NewrenApr 1, 2023
  18. Junio C HamanoApr 3, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.