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

[BUG REPORT] sparseIndexExpanded hint always shows on sparse worktree move

From
Brian Lyles <brianmlyles@gmail.com>
Date
Aug 8, 2024, 02:07 UTC
Message-ID
<17e99eb90d57089d.70b1dd9aae081c6e.203dcd72f6563036@zivdesk>

After updating to v2.46.0, the "sparse index is expanding to a full index" hint added in 9479a31d60 (advice: warn when sparse index expands, 2024-07-08) seems to show any time a worktree using a sparse index is moved. This is easily reproduced with the following script:

    git init --initial-branch=main main-worktree
    mkdir main-worktree/A main-worktree/B
    touch main-worktree/A/a.txt main-worktree/B/b.txt
    git -C main-worktree add .
    git -C main-worktree commit -m "initial commit"
    git -C main-worktree worktree add --no-checkout ../other-worktree -b other main
    git -C other-worktree sparse-checkout set A --sparse-index
    git -C other-worktree checkout
    git -C main-worktree worktree move ../other-worktree ../other-worktree-moved

It does not appear that the index is ever actually touched. Testing in a real repository shows that the index size does not change, nor does its last modified timestamp.

I've reproduced this on Windows, MacOS, and Gentoo Linux.
-- 
Thank you,
Brian Lyles
Next: Derrick Stolee
Message 1 of 3 in “[BUG REPORT] sparseIndexExpanded hint always shows on sparse worktree move”
  1. Brian LylesAug 8, 2024
  2. Derrick StoleeAug 15, 2024
  3. Brian LylesSep 10, 2024

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.