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

Re: [PATCH 1/5] t1092: test merge conflicts outside cone

From
Derrick Stolee <stolee@gmail.com>
Date
Jul 26, 2021, 14:10 UTC
Message-ID
<ced1c678-225b-c915-d019-f9ebfb3898b6@gmail.com>
In-Reply-To
<CABPp-BF-UVZKWmsohjCzRLpbHZii+1g=SShEYg_cwScsOHi=5g@mail.gmail.com>
On 7/23/2021 1:34 PM, Elijah Newren wrote:
> On Wed, Jul 21, 2021 at 2:07 PM Derrick Stolee via GitGitGadget
> <gitgitgadget@gmail.com> wrote:
>>
>> From: Derrick Stolee <dstolee@microsoft.com>
...
>> +       # 3. rename the file to another sparse filename
> 
> But...that doesn't resolve the conflict.  Shouldn't this be titled
> "accept the conflict & rename the file elsewhere"?
Sure. I'm less focused on the content of the file and more the steps
the user might have taken to resolve the conflict.
 
Show 5 quoted lines
>> +       run_on_all mv folder2/a folder2/z &&
>> +       test_all_match git add folder2 &&
> 
> 'mv' rather than 'git mv', then followed by 'git add'?  Any reason for
> this order rather than git add followed by git mv?

I'm trying to mimic that a user might realize that a filename might need to be renamed (say, because a naming convention changed that is causing the conflict) and I don't expect users to use 'git mv' to do this action.

> Also, if you really do want to move first, did you use mv instead of
> "git mv" due to the latter's shortcoming of only operating on stage 0?
> (https://lore.kernel.org/git/CABPp-BGJdwpwhQUp4Wa4bKBp4hQFB9OM3N1FXH7SzY0mvLDa7Q@mail.gmail.com/)

'git mv' had not occurred to me as a thing to do in this case. I'm focused on ensuring that 'git add' works as expected to update the index in response to filesystem changes.

> Regardless of order, though, I still think mv or add should require a
> --force to rename or add a file outside the sparsity paths given the
> deferred negative surprises for users around such files.  (Or come up
> with a solid way to remove those surprises.)

--force is focused on _ignored_ files. I imagine that it could be repurposed to allow entries outside of the sparse-checkout definition, but we would want to be careful for users who are adding the entire directory, not just the individual files, as they might _also_ get any ignored files that exist in that directory. That might justify creating a new option instead.

Further, the error message reported when adding something outside of the sparse cone should probably mention whatever option exists as a way for users to bypass this limitation. I'll collect my thoughts (in response to your detailed thoughts shared on my cover letter) and start a new thread about hardening this behavior. I've got an internal ticket tracking this, and I want to wrap my head around all of the interesting commands (add, mv, rm, update-index?) and create a full recommendation to bring as an RFC.

Of course, if someone else wants to create this clear vision in the meantime I will not complain.

Thanks, -Stolee

Previous: Elijah NewrenNext: Derrick Stolee via GitGitGadget
Message 6 of 38 in “Sparse Index: Integrate with 'git add'”
  1. 0/5 Sparse Index: Integrate with 'git add'Derrick Stolee via GitGitGadget, Jul 21, 2021
  2. 1/5 t1092: test merge conflicts outside coneDerrick Stolee via GitGitGadget, Jul 21, 2021
  3. Elijah NewrenJul 23, 2021
  4. Eric SunshineJul 23, 2021
  5. Elijah NewrenJul 23, 2021
  6. Derrick StoleeJul 26, 2021
  7. 2/5 add: allow operating on a sparse-only indexDerrick Stolee via GitGitGadget, Jul 21, 2021
  8. Junio C HamanoJul 21, 2021
  9. Derrick StoleeJul 21, 2021
  10. Elijah NewrenJul 23, 2021
  11. Derrick StoleeJul 26, 2021
  12. Derrick StoleeJul 26, 2021
  13. 3/5 pathspec: stop calling ensure_full_indexDerrick Stolee via GitGitGadget, Jul 21, 2021
  14. Elijah NewrenJul 23, 2021
  15. 4/5 t1092: 'git add --refresh' difference with sparse-indexDerrick Stolee via GitGitGadget, Jul 21, 2021
  16. 5/5 add: ignore outside the sparse-checkout in refresh()Derrick Stolee via GitGitGadget, Jul 21, 2021
  17. Elijah NewrenJul 23, 2021
  18. Elijah NewrenJul 23, 2021
  19. Elijah NewrenJul 23, 2021
  20. 0/5 Sparse Index: Integrate with 'git add'Derrick Stolee via GitGitGadget, Jul 26, 2021
  21. 1/5 t1092: test merge conflicts outside coneDerrick Stolee via GitGitGadget, Jul 26, 2021
  22. 2/5 add: allow operating on a sparse-only indexDerrick Stolee via GitGitGadget, Jul 26, 2021
  23. 4/5 add: ignore outside the sparse-checkout in refresh()Derrick Stolee via GitGitGadget, Jul 26, 2021
  24. 3/5 pathspec: stop calling ensure_full_indexDerrick Stolee via GitGitGadget, Jul 26, 2021
  25. 5/5 add: remove ensure_full_index() with --renormalizeDerrick Stolee via GitGitGadget, Jul 26, 2021
  26. Elijah NewrenJul 28, 2021
  27. Derrick StoleeJul 29, 2021
  28. Elijah NewrenJul 29, 2021
  29. Derrick StoleeJul 29, 2021
  30. Elijah NewrenJul 30, 2021
  31. 0/5 Sparse Index: Integrate with 'git add'Derrick Stolee via GitGitGadget, Jul 29, 2021
  32. 2/5 add: allow operating on a sparse-only indexDerrick Stolee via GitGitGadget, Jul 29, 2021
  33. 1/5 t1092: test merge conflicts outside coneDerrick Stolee via GitGitGadget, Jul 29, 2021
  34. 4/5 add: ignore outside the sparse-checkout in refresh()Derrick Stolee via GitGitGadget, Jul 29, 2021
  35. 3/5 pathspec: stop calling ensure_full_indexDerrick Stolee via GitGitGadget, Jul 29, 2021
  36. 5/5 add: remove ensure_full_index() with --renormalizeDerrick Stolee via GitGitGadget, Jul 29, 2021
  37. Elijah NewrenJul 29, 2021
  38. Junio C HamanoJul 29, 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.