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

Re: [PATCH v2 0/4] Integrate the sparse index with 'git apply' and interactive add, checkout, and reset

From
Elijah Newren <newren@gmail.com>
Date
May 16, 2025, 15:32 UTC
Message-ID
<CABPp-BFmgAsps=Y+YE=dTUxnGSKj+49jNxODdQDOnvuF7XzKZA@mail.gmail.com>
In-Reply-To
<pull.1914.v2.git.1747407330.gitgitgadget@gmail.com>

On Fri, May 16, 2025 at 7:55 AM Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com> wrote:

>
[...]
Show 11 quoted lines
> Updates in v2
> =============
>
> Thanks for the careful review from Elijah and the pointer from Phillip, we
> have these changes:
>
>  1. The tests no longer have different expansion behaviors for 'git add -p'
>     and 'git add -i' due to partially-expanded indexes on disk.
>  2. We now test 'git checkout -p' and 'git reset -p'.
>  3. 'git reset -p' needed some changes to the builtin (similar to 'git add')
>     to be fast.

I haven't looked at the new patch yet, but the updated patches 1 & 2 look much improved (though there's still one problem with the new commit message, which I comment on in the range-diff below).

However, I think Junio already merged your v1 to next (https://lore.kernel.org/git/CABPp-BEukTWwsuC7MMR8D5_UAhyw-LgT=DsPKAWeR_ZmVVhjzQ@mail.gmail.com/). So he'll either have to revert your v1 in next and apply the new series on top, or you'll need to re-roll as fixes on top of your v1.

Show 18 quoted lines
>  2:  63caae87634 ! 2:  0a2752721d0 git add: make -p/-i aware of sparse index
>      @@ Commit message
>
>           It turns out that control flows out of cmd_add() in the interactive
>           cases before the lines that confirm that the builtin is integrated with
>      -    the sparse index. We need to move that earlier to ensure it prevents a
>      -    full index expansion on read.
>      +    the sparse index.
>
>      -    Add more test cases that confirm that these interactive add options work
>      -    with the sparse index. One interesting aspect here is that the '-i'
>      -    option avoids expanding the sparse index when a sparse directory exists
>      -    on disk while the '-p' option does hit the ensure_full_index() method.
>      -    This leaves some room for improvement, but this case should be atypical
>      -    as users should remain within their sparse-checkout.
>      +    Moving that integration point earlier in cmd_add() allows 'git add -p'
>      +    and 'git add -p' to operate without expanding a sparse index to a full
>      +    one.
Was the second 'git add -p' meant to be 'git add -i'?
>  -:  ----------- > 3:  d1482a29d8f reset: integrate sparse index with --patch

Other than the one comment above, your changes from the range-diff look good to me for patches 1 & 2, and the new 4. I haven't looked at this new patch 3 yet but wanted to comment on the merged-to-next issue.

Previous: Derrick Stolee via GitGitGadgetNext: Derrick Stolee
Message 20 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.