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

Re: [PATCH v3 5/7] refresh_index(): add REFRESH_DONT_MARK_SPARSE_MATCHES flag

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 19, 2021, 16:05 UTC
Message-ID
<xmqqlfajnn6w.fsf@gitster.g>
In-Reply-To
<CAHd-oW4V4_XrY7XfQO1gLEZZmzcLbG0_M2ys+Meh4Ysu0Psz0Q@mail.gmail.com>
Matheus Tavares Bernardino <matheus.bernardino@usp.br> writes:
Show 15 quoted lines
>> In other words, the change makes me wonder why we are not adding a
>> flag that says "do we or do we not want to match paths outside the
>> sparse checkout cone?", with which the seen[] would automatically
>> record the right thing.
>
> Yeah, makes sense. I didn't want to make the flag skip the sparse
> paths unconditionally (i.e. without matching them) because then we
> would also skip the ce_stage() checkings below and the later
> ce_mark_uptodate(). And I wasn't sure whether this could cause any
> unwanted side effects.
>
> But thinking more carefully about this now, unmerged paths should
> never have the SKIP_WORKTREE bit set anyway, right? What about the
> CE_UPTODATE mark, would it be safe to skip it? I'm not very familiar
> with this code, but I'll try to investigate more later.

I do not offhand know the answers to these questions you ask in the last paragraph myself, and it could turn out to be that the "let processing go as before, matching what those excluded paths by the matcher, but making the caller responsible for filtering out the paths excluded by sparcity out of the result from the matcher, but tweak seen[]" approach, however ugly, is the most practical, after your investigation. But I'd prefer to see how bad the situation is first ;-).

Thanks.
Previous: Matheus Tavares BernardinoNext: Matheus Tavares Bernardino
Message 10 of 32 in “add/rm: honor sparse checkout and warn on sparse paths”
  1. 0/7 add/rm: honor sparse checkout and warn on sparse pathsMatheus Tavares, Mar 12, 2021
  2. 2/7 t3705: add tests for `git add` in sparse checkoutsMatheus Tavares, Mar 12, 2021
  3. Derrick StoleeMar 23, 2021
  4. 1/7 add: include magic part of pathspec on --refresh errorMatheus Tavares, Mar 12, 2021
  5. 4/7 pathspec: allow to ignore SKIP_WORKTREE entries on index matchingMatheus Tavares, Mar 12, 2021
  6. 5/7 refresh_index(): add REFRESH_DONT_MARK_SPARSE_MATCHES flagMatheus Tavares, Mar 12, 2021
  7. Junio C HamanoMar 18, 2021
  8. Junio C HamanoMar 19, 2021
  9. Matheus Tavares BernardinoMar 19, 2021
  10. Junio C HamanoMar 19, 2021
  11. Matheus Tavares BernardinoMar 30, 2021
  12. Elijah NewrenMar 31, 2021
  13. 3/7 add: make --chmod and --renormalize honor sparse checkoutsMatheus Tavares, Mar 12, 2021
  14. 6/7 add: warn when asked to update SKIP_WORKTREE entriesMatheus Tavares, Mar 12, 2021
  15. 7/7 rm: honor sparse checkout patternsMatheus Tavares, Mar 12, 2021
  16. Ævar Arnfjörð BjarmasonMar 21, 2021
  17. Matheus Tavares BernardinoMar 22, 2021
  18. Derrick StoleeMar 23, 2021
  19. Elijah NewrenMar 13, 2021
  20. 0/7 add/rm: honor sparse checkout and warn on sparse pathsMatheus Tavares, Apr 8, 2021
  21. 1/7 add: include magic part of pathspec on --refresh errorMatheus Tavares, Apr 8, 2021
  22. 2/7 t3705: add tests for `git add` in sparse checkoutsMatheus Tavares, Apr 8, 2021
  23. Derrick StoleeApr 14, 2021
  24. 3/7 add: make --chmod and --renormalize honor sparse checkoutsMatheus Tavares, Apr 8, 2021
  25. 4/7 pathspec: allow to ignore SKIP_WORKTREE entries on index matchingMatheus Tavares, Apr 8, 2021
  26. 5/7 refresh_index(): add flag to ignore SKIP_WORKTREE entriesMatheus Tavares, Apr 8, 2021
  27. 6/7 add: warn when asked to update SKIP_WORKTREE entriesMatheus Tavares, Apr 8, 2021
  28. 7/7 rm: honor sparse checkout patternsMatheus Tavares, Apr 8, 2021
  29. Elijah NewrenApr 14, 2021
  30. Matheus Tavares BernardinoApr 14, 2021
  31. Junio C HamanoApr 16, 2021
  32. Elijah NewrenApr 16, 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.