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

Re: [PATCH 0/3] Integrate the sparse index with 'git apply' and 'git add -p/-i'

From
Derrick Stolee <stolee@gmail.com>
Date
May 16, 2025, 13:28 UTC
Message-ID
<6736f2fd-a91d-4ffd-b421-6670a0e028d8@gmail.com>
In-Reply-To
<c1f7a9d6-4a44-4c00-bf26-6852819361e9@gmail.com>
On 5/14/25 11:16 AM, Phillip Wood wrote:
> This made me wonder about the other commands that take "--patch" like checkout 
> and reset. Do you know how well they handle the sparse index? They'll all 
> benefit from the changes to git apply in this series but I was wondering if they 
> need any further changes.
By adding these two tests...
   test_perf_on_all 'test_write_lines y y y | git checkout --patch -'
   test_perf_on_all 'echo >>a && git add a && test_write_lines y | git reset 
--patch'

...we can demonstrate that the changes to 'git apply' are sufficient to get the improvements we seek for 'git checkout --patch':

Test HEAD~3 HEAD~2 --------------------------------------------------------------- ... git checkout --patch - (full-v3) 1.22 1.22 +0.0% ... git checkout --patch - (full-v4) 1.15 1.16 +0.9% ... git checkout --patch - (sparse-v3) 1.37 0.11 -92.0% ... git checkout --patch - (sparse-v4) 1.37 0.11 -92.0% ... git reset --patch (full-v3) 0.82 0.81 -1.2% ... git reset --patch (full-v4) 0.76 0.77 +1.3% ... git reset --patch (sparse-v3) 1.57 0.91 -42.0% ... git reset --patch (sparse-v4) 1.59 0.92 -42.1%

But 'git reset --patch' appears to not be fast _enough_. It turns out that it has the same issue as cmd_add(). I'll add a patch for this purpose.

Thanks, -Stolee

Previous: Phillip WoodNext: phillip.wood123@gmail.com
Message 12 of 22 in “Integrate the sparse index with 'git apply' and 'git add -p/-i'”
  1. 0/3 Integrate the sparse index with 'git apply' and 'git add -p/-i'Derrick Stolee via GitGitGadget, May 7, 2025
  2. 1/3 apply: integrate with the sparse indexDerrick Stolee via GitGitGadget, May 7, 2025
  3. Elijah NewrenMay 10, 2025
  4. Derrick StoleeMay 16, 2025
  5. 2/3 git add: make -p/-i aware of sparse indexDerrick Stolee via GitGitGadget, May 7, 2025
  6. Elijah NewrenMay 10, 2025
  7. Derrick StoleeMay 16, 2025
  8. 3/3 p2000: add performance test for 'git add -p'Derrick Stolee via GitGitGadget, May 7, 2025
  9. Elijah NewrenMay 10, 2025
  10. Junio C HamanoMay 8, 2025
  11. Phillip WoodMay 14, 2025
  12. Derrick StoleeMay 16, 2025
  13. phillip.wood123@gmail.comMay 20, 2025
  14. 0/4 Integrate the sparse index with 'git apply' and interactive add, checkout, and resetDerrick Stolee via GitGitGadget, May 16, 2025
  15. 1/4 apply: integrate with the sparse indexDerrick Stolee via GitGitGadget, May 16, 2025
  16. 2/4 git add: make -p/-i aware of sparse indexDerrick Stolee via GitGitGadget, May 16, 2025
  17. 3/4 reset: integrate sparse index with --patchDerrick Stolee via GitGitGadget, May 16, 2025
  18. Elijah NewrenMay 16, 2025
  19. 4/4 p2000: add performance test for patch-mode commandsDerrick Stolee via GitGitGadget, May 16, 2025
  20. Elijah NewrenMay 16, 2025
  21. Derrick StoleeMay 16, 2025
  22. Junio C HamanoMay 16, 2025

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.