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

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

From
Elijah Newren <newren@gmail.com>
Date
Mar 19, 2023, 04:28 UTC
Message-ID
<CABPp-BGBBptR-BLGzd43w26uzKazK77f9goPbVCXv+Y0-FzbvQ@mail.gmail.com>
In-Reply-To
<pull.1488.git.1678283349.gitgitgadget@gmail.com>
Hi,

On Wed, Mar 8, 2023 at 5:49 AM William Sprent via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 26 quoted lines
>
> 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/

Sorry for the delay in reviewing. Patch 1 looks good to me. Patch 2 looks really good as well, but there were a few minor things that we might be able to touch up.

And now that I've played with it and tested a little bit locally, I really like the idea of having this functionality around. Thanks for sending it in.

Show 17 quoted lines
> 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
Previous: William SprentNext: William Sprent via GitGitGadget
Message 10 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.