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

Re: [PATCH v2 4/5] t1091/t3705: remove 'test-tool read-cache --table'

From
Elijah Newren <newren@gmail.com>
Date
Dec 9, 2021, 05:20 UTC
Message-ID
<CABPp-BHkdyMD1RVptCgROnd=1pw_xvhOj4b1pvYFRmukqyvbNQ@mail.gmail.com>
In-Reply-To
<b98e5e6d2bc921ea76d8b5419d1f00e9db30a55a.1638992396.git.gitgitgadget@gmail.com>

On Wed, Dec 8, 2021 at 11:40 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:

Show 10 quoted lines
>
> From: Derrick Stolee <dstolee@microsoft.com>
>
> Now that 'git ls-files --sparse' exists, we can use it to verify the
> state of a sparse index instead of 'test-tool read-cache table'. Replace
> these usages within t1091-sparse-checkout-builtin.sh and
> t3705-add-sparse-checkout.sh.
>
> The important changes are due to the different output format. In t3705,
> wWe need to use the '--stage' output to get a file mode and OID, but
s/wWe/we/
Show 74 quoted lines
> it also includes a stage value and drops the object type. This leads
> to some differences in how we handle looking for specific entries.
>
> In t1091, the test focuses on enabling the sparse index, so we do not
> need the --stage flag to demonstrate how the index changes, and instead
> can use a diff.
>
> Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
> ---
>  t/t1091-sparse-checkout-builtin.sh | 25 ++++++++++++++++++++-----
>  t/t3705-add-sparse-checkout.sh     |  8 ++++----
>  2 files changed, 24 insertions(+), 9 deletions(-)
>
> diff --git a/t/t1091-sparse-checkout-builtin.sh b/t/t1091-sparse-checkout-builtin.sh
> index 272ba1b566b..680e0043c36 100755
> --- a/t/t1091-sparse-checkout-builtin.sh
> +++ b/t/t1091-sparse-checkout-builtin.sh
> @@ -212,12 +212,27 @@ test_expect_success 'sparse-index enabled and disabled' '
>
>                 git -C repo sparse-checkout init --cone --sparse-index &&
>                 test_cmp_config -C repo true index.sparse &&
> -               test-tool -C repo read-cache --table >cache &&
> -               grep " tree " cache &&
> -
> +               git -C repo ls-files --sparse >sparse &&
>                 git -C repo sparse-checkout disable &&
> -               test-tool -C repo read-cache --table >cache &&
> -               ! grep " tree " cache &&
> +               git -C repo ls-files --sparse >full &&
> +
> +               cat >expect <<-\EOF &&
> +               @@ -1,4 +1,7 @@
> +                a
> +               -deep/
> +               -folder1/
> +               -folder2/
> +               +deep/a
> +               +deep/deeper1/a
> +               +deep/deeper1/deepest/a
> +               +deep/deeper2/a
> +               +folder1/a
> +               +folder2/a
> +               EOF
> +
> +               diff -u sparse full | tail -n +3 >actual &&
> +               test_cmp expect actual &&
> +
>                 git -C repo config --list >config &&
>                 ! grep index.sparse config
>         )
> diff --git a/t/t3705-add-sparse-checkout.sh b/t/t3705-add-sparse-checkout.sh
> index f3143c92908..81f3384eeed 100755
> --- a/t/t3705-add-sparse-checkout.sh
> +++ b/t/t3705-add-sparse-checkout.sh
> @@ -181,13 +181,13 @@ test_expect_success 'git add fails outside of sparse-checkout definition' '
>         # Avoid munging CRLFs to avoid an error message
>         git -c core.autocrlf=input add --sparse sparse_entry 2>stderr &&
>         test_must_be_empty stderr &&
> -       test-tool read-cache --table >actual &&
> -       grep "^100644 blob.*sparse_entry\$" actual &&
> +       git ls-files --stage >actual &&
> +       grep "^100644 .*sparse_entry\$" actual &&
>
>         git add --sparse --chmod=+x sparse_entry 2>stderr &&
>         test_must_be_empty stderr &&
> -       test-tool read-cache --table >actual &&
> -       grep "^100755 blob.*sparse_entry\$" actual &&
> +       git ls-files --stage >actual &&
> +       grep "^100755 .*sparse_entry\$" actual &&
>
>         git reset &&
>
> --
> gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee via GitGitGadget
Message 30 of 51 in “Sparse index: fetch, pull, ls-files”
  1. 0/2 Sparse index: fetch, pull, ls-filesDerrick Stolee via GitGitGadget, Nov 16, 2021
  2. 1/2 fetch/pull: use the sparse indexDerrick Stolee via GitGitGadget, Nov 16, 2021
  3. 2/2 ls-files: add --sparse optionDerrick Stolee via GitGitGadget, Nov 16, 2021
  4. Elijah NewrenNov 22, 2021
  5. Derrick StoleeNov 22, 2021
  6. Ævar Arnfjörð BjarmasonNov 23, 2021
  7. Derrick StoleeDec 8, 2021
  8. Derrick StoleeDec 8, 2021
  9. Elijah NewrenDec 8, 2021
  10. Derrick StoleeDec 8, 2021
  11. Elijah NewrenDec 8, 2021
  12. Derrick StoleeDec 8, 2021
  13. Ævar Arnfjörð BjarmasonDec 9, 2021
  14. Derrick StoleeDec 10, 2021
  15. Ævar Arnfjörð BjarmasonDec 10, 2021
  16. Junio C HamanoDec 13, 2021
  17. Derrick StoleeDec 16, 2021
  18. Junio C HamanoNov 17, 2021
  19. Derrick StoleeNov 17, 2021
  20. Junio C HamanoNov 18, 2021
  21. Ævar Arnfjörð BjarmasonNov 23, 2021
  22. 0/5 Sparse index: fetch, pull, ls-filesDerrick Stolee via GitGitGadget, Dec 8, 2021
  23. 1/5 fetch/pull: use the sparse indexDerrick Stolee via GitGitGadget, Dec 8, 2021
  24. 2/5 ls-files: add --sparse optionDerrick Stolee via GitGitGadget, Dec 8, 2021
  25. Elijah NewrenDec 9, 2021
  26. Derrick StoleeDec 10, 2021
  27. 3/5 t1092: replace 'read-cache --table' with 'ls-files --sparse'Derrick Stolee via GitGitGadget, Dec 8, 2021
  28. Elijah NewrenDec 9, 2021
  29. 4/5 t1091/t3705: remove 'test-tool read-cache --table'Derrick Stolee via GitGitGadget, Dec 8, 2021
  30. Elijah NewrenDec 9, 2021
  31. 5/5 test-read-cache: remove --table, --expand optionsDerrick Stolee via GitGitGadget, Dec 8, 2021
  32. Elijah NewrenDec 9, 2021
  33. 0/5 Sparse index: fetch, pull, ls-filesDerrick Stolee via GitGitGadget, Dec 10, 2021
  34. 1/5 fetch/pull: use the sparse indexDerrick Stolee via GitGitGadget, Dec 10, 2021
  35. 2/5 ls-files: add --sparse optionDerrick Stolee via GitGitGadget, Dec 10, 2021
  36. 3/5 t1092: replace 'read-cache --table' with 'ls-files --sparse'Derrick Stolee via GitGitGadget, Dec 10, 2021
  37. 4/5 t1091/t3705: remove 'test-tool read-cache --table'Derrick Stolee via GitGitGadget, Dec 10, 2021
  38. 5/5 test-read-cache: remove --table, --expand optionsDerrick Stolee via GitGitGadget, Dec 10, 2021
  39. Ævar Arnfjörð BjarmasonDec 10, 2021
  40. Elijah NewrenDec 10, 2021
  41. Ævar Arnfjörð BjarmasonDec 11, 2021
  42. Elijah NewrenDec 11, 2021
  43. Elijah NewrenDec 10, 2021
  44. 0/5 Sparse index: fetch, pull, ls-filesDerrick Stolee via GitGitGadget, Dec 22, 2021
  45. 1/5 fetch/pull: use the sparse indexDerrick Stolee via GitGitGadget, Dec 22, 2021
  46. 2/5 ls-files: add --sparse optionDerrick Stolee via GitGitGadget, Dec 22, 2021
  47. 3/5 t1092: replace 'read-cache --table' with 'ls-files --sparse'Derrick Stolee via GitGitGadget, Dec 22, 2021
  48. 4/5 t1091/t3705: remove 'test-tool read-cache --table'Derrick Stolee via GitGitGadget, Dec 22, 2021
  49. 5/5 test-read-cache: remove --table, --expand optionsDerrick Stolee via GitGitGadget, Dec 22, 2021
  50. Elijah NewrenDec 22, 2021
  51. Junio C HamanoDec 22, 2021

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.