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

Re: [PATCH v2 0/4] rm: integrate with sparse-index

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 8, 2022, 17:24 UTC
Message-ID
<xmqqmtcesl6e.fsf@gitster.g>
In-Reply-To
<20220807041335.1790658-1-shaoxuan.yuan02@gmail.com>
Shaoxuan Yuan <shaoxuan.yuan02@gmail.com> writes:
> Turn on sparse-index feature within `git-rm` command.
That is a clearly written single-line summary.
> Add necessary modifications and test them.

This states an obvious without adding any useful information. What modifications were necessary and why they were necessary, what old behaviour was undesirable and added tests prevent them to appear again? These details are better left to the proposed log message of individual patches.

This series, when queued on top of 'master' without anything else, seems to pass its own tests, but when combined with the "reset and checkout fixes" <pull.1312.v2.git.1659841030.gitgitgadget@gmail.com> by Victoria, the last one t1092 fails.

---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 
expecting success of 1092.27 'reset hard with removed sparse dir':
        init_repos &&
        test_all_match git rm -r --sparse folder1 &&
        test_all_match git status --porcelain=v2 &&
        test_all_match git reset --hard &&
        test_all_match git status --porcelain=v2 &&
        cat >expect <<-\EOF &&
        folder1/
        EOF
        git -C sparse-index ls-files --sparse folder1 >out &&
        test_cmp expect out

HEAD is now at 703fd3e initial commit HEAD is now at 703fd3e initial commit HEAD is now at 703fd3e initial commit --- full-checkout-out 2022-08-08 17:19:19.820840016 +0000 +++ sparse-index-out 2022-08-08 17:19:19.836841239 +0000

@@ -1,3 +1 @@
-rm 'folder1/0/0/0'
-rm 'folder1/0/1'
-rm 'folder1/a'
+rm 'folder1/'
not ok 27 - reset hard with removed sparse dir
#
#               init_repos &&
#
#               test_all_match git rm -r --sparse folder1 &&
#               test_all_match git status --porcelain=v2 &&
#
#               test_all_match git reset --hard &&
#               test_all_match git status --porcelain=v2 &&
#
#               cat >expect <<-\EOF &&
#               folder1/
#               EOF
#
#               git -C sparse-index ls-files --sparse folder1 >out &&
#               test_cmp expect out
#
---- ---- ---- ---- ---- ---- ---- ---- ---- ---- 

When we have the index (incorrectly) fully expanded, and may have
(incorrectly) working tree files outside of our sparse-cone of
interest, we may have paths under the 'folder1/' that we may need to
remove (and report as removed), but after the bug that causes us to
"incorrectly check out" gets fixed, perhaps the 'folder1/' is the
only thing that needs removed if it is outside our sparse-cone of
interest?  IOW, is the test hardcoding the behaviour of a bug that
was fixed?  I dunno.
Previous: Shaoxuan YuanNext: Victoria Dye
Message 20 of 25 in “rm: integrate with sparse-index”
  1. 0/4 rm: integrate with sparse-indexShaoxuan Yuan, Aug 3, 2022
  2. 2/4 pathspec.h: move pathspec_needs_expanded_index() from reset.c to hereShaoxuan Yuan, Aug 3, 2022
  3. Derrick StoleeAug 3, 2022
  4. Shaoxuan YuanAug 5, 2022
  5. 3/4 rm: expand the index only when necessaryShaoxuan Yuan, Aug 3, 2022
  6. Derrick StoleeAug 3, 2022
  7. Shaoxuan YuanAug 5, 2022
  8. 1/4 t1092: add tests for `git-rm`Shaoxuan Yuan, Aug 3, 2022
  9. Derrick StoleeAug 3, 2022
  10. 4/4 rm: integrate with sparse-indexShaoxuan Yuan, Aug 3, 2022
  11. Derrick StoleeAug 4, 2022
  12. Shaoxuan YuanAug 6, 2022
  13. 0/4 rm: integrate with sparse-indexShaoxuan Yuan, Aug 7, 2022
  14. 1/4 t1092: add tests for `git-rm`Shaoxuan Yuan, Aug 7, 2022
  15. Derrick StoleeAug 10, 2022
  16. 2/4 pathspec.h: move pathspec_needs_expanded_index() from reset.c to hereShaoxuan Yuan, Aug 7, 2022
  17. 3/4 rm: expand the index only when necessaryShaoxuan Yuan, Aug 7, 2022
  18. Victoria DyeAug 10, 2022
  19. 4/4 rm: integrate with sparse-indexShaoxuan Yuan, Aug 7, 2022
  20. Junio C HamanoAug 8, 2022
  21. Victoria DyeAug 8, 2022
  22. Junio C HamanoAug 8, 2022
  23. Victoria DyeAug 10, 2022
  24. Shaoxuan YuanAug 10, 2022
  25. Junio C HamanoAug 12, 2022

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.