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

Re: [PATCH] unpack-trees: add core.sparseCheckoutRmFiles config

From
TSTim Renouf (open source) <tpr.ll@botech.co.uk>
Date
Jun 2, 2021, 06:13 UTC
Message-ID
<9BCB8981-09D5-4BF4-981B-2BF0AA0D6E5A@botech.co.uk>
In-Reply-To
<CABPp-BHs0ACvkCJMB-tO8xkiidB12NrN1hOhLRvm3U_Q=r2YcQ@mail.gmail.com>
Hi all
Thanks for the reviews and comments.
My use case is that I never want it to remove or otherwise touch those files outside of sparse-checkout that happen to be the same path as index paths. I realize that currently gives me complications (e.g. I must never try and merge/cherry-pick/rebase a commit that might cause a merge conflict out there), and I realize that’s not what everyone else wants. For example, I don’t want git reset --hard or whatever to remove those files. Hence the config option.
Am I right in saying that the sparse-index work makes it easier to achieve my use case? In that those outside-sparse-checkout paths would not ever get merged into the index, even if I merge/cherry-pick/rebase a tree with paths there?
I can go into more details on how I arrived ay my use case if it helps.
So maybe there are two separate things here:
1. The bug that checkout removes my file when it is dirty, instead of refusing (unless -f) or just ignoring it.
2. My use case, which is to do its best to never remove or otherwise touch worktree files outside sparse-checkout.
> I'm also worried that making a config option may have masked subtle
> bugs in the patch that the rest of the testsuite would have turned up.
It is true that not hiding it in a config option makes a few tests fail, including ones that specifically test that a git reset after a materialization from a merge conflict causes the file to be removed.
Thanks.
-tpr
Previous: Elijah NewrenNext: Elijah Newren
Message 7 of 10 in “bug report: git checkout deletes worktree file even though it is excluded by sparse-checkout”
  1. Tim Renouf (open source)May 28, 2021
  2. Elijah NewrenMay 28, 2021
  3. unpack-trees: add core.sparseCheckoutRmFiles configTim Renouf, Jun 1, 2021
  4. Derrick StoleeJun 2, 2021
  5. Junio C HamanoJun 2, 2021
  6. Elijah NewrenJun 2, 2021
  7. Tim Renouf (open source)Jun 2, 2021
  8. Elijah NewrenJun 2, 2021
  9. Tim Renouf (open source)Jun 5, 2021
  10. Derrick StoleeJun 2, 2021

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.