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

Re: [RFC PATCH 1/1] mv: integrate with sparse-index

From
Shaoxuan Yuan <shaoxuan.yuan02@gmail.com>
Date
Mar 27, 2022, 03:48 UTC
Message-ID
<CAJyCBOQT1TwkNX_be9B3uKsv4Buf_ojfZoqfTAUqQ22Na7dY=g@mail.gmail.com>
In-Reply-To
<97a665fe-07c9-c4f6-4ab6-b6c0e1397c31@github.com>
On Fri, Mar 18, 2022 at 5:57 AM Victoria Dye <vdye@github.com> wrote:
Hi all,
It's been a busy week, I'm sorry that did not have much time to respond.

================================= A brief summary of my latest investigations:

I think the 'git mv' command still has some questionable aspects, especially with the 'git sparse-checkout' command. And I feel we have to sort things out between 'git mv' and sparse-checkout first, then proceed to the issues with sparse-index. ===========

I'm trying to fix the first 2 of the 3 potential things mentioned earlier.
> 1. When empty folder2/ is on-disk, 'git mv' (without '--sparse') doesn't
>    fail with "bad source", even though it should.

In this case, 'git mv' does not fail with "bad source" is something expected, because this error is related to the existence of an on-disk file, not a directory. The closest thing that it should fail with, in my opinion, is by calling the advise function 'advise_on_updating_sparse_paths'.

With that being said, I now raise the first question: should we change the sparse- checkout cone check to be placed at the very beginning of the checking process, or keep it at the end as a very final check (where it is right now). My preference is to place it at the very beginning, since the user should always be cautious about touching contents outside of sparse-checkout cone, no matter what.

If a certain move touches out-of-cone stuff, and at the same time it will fail with the, for example, "destination exists" or "conflicted" error, I think these errors should come second, after being supplied with the "--sparse" flag.

> 2. When you try to move a sparse file with 'git mv --sparse', it still
>    fails.

This is also related to the first question, because in this case, "folder2/a" is not on-disk, then 'git mv' will fail fast at the first check and ignore the "--sparse" flag. Even if we modify the code to place the out-of-cone check at the very beginning, and supply a "--sparse" flag, we have to make 'git mv' look into the index to find a sparse file. And here I raise my second question: by moving a sparse file, which is normally not on-disk, we have to alter the original 'git mv' logic to make it grope into the index for the missing sparse file (for now it does not care about the index, except when it receives a directory as <source>); can we make this change?

-- Thanks & Regards, Shaoxuan

Previous: Junio C HamanoNext: Derrick Stolee
Message 19 of 22 in “mv: integrate with sparse-index”
  1. 0/1 mv: integrate with sparse-indexShaoxuan Yuan, Mar 15, 2022
  2. 1/1 mv: integrate with sparse-indexShaoxuan Yuan, Mar 15, 2022
  3. Victoria DyeMar 15, 2022
  4. Derrick StoleeMar 15, 2022
  5. Shaoxuan YuanMar 16, 2022
  6. Shaoxuan YuanMar 17, 2022
  7. Shaoxuan YuanMar 16, 2022
  8. Shaoxuan YuanMar 16, 2022
  9. Derrick StoleeMar 16, 2022
  10. Shaoxuan YuanMar 16, 2022
  11. Victoria DyeMar 17, 2022
  12. Junio C HamanoMar 18, 2022
  13. Derrick StoleeMar 21, 2022
  14. Junio C HamanoMar 21, 2022
  15. Derrick StoleeMar 21, 2022
  16. Shaoxuan YuanMar 22, 2022
  17. Derrick StoleeMar 23, 2022
  18. Junio C HamanoMar 23, 2022
  19. Shaoxuan YuanMar 27, 2022
  20. Derrick StoleeMar 28, 2022
  21. Junio C HamanoMar 15, 2022
  22. Derrick StoleeMar 15, 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.