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

Re: [BUG] merge-recursive overly aggressive when skipping updating the working tree

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 20, 2018, 22:05 UTC
Message-ID
<xmqqbmb1a7ga.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CABPp-BE_OHxMqmhJ8BisG6HFpGQjsPJ1AE4G9m5bpJWznkq-1Q@mail.gmail.com>
Elijah Newren <newren@gmail.com> writes:
> Ah, okay, that's helpful.  So, if there are conflicts, it should be
> free to clear the skip_worktree flag.  Since merge-recursive calls
> add_cacheinfo() for all entries it needs to update, which deletes the
> old cache entry and just makes new ones, we get that for free.
Correct.
> And conversely, if a file-level merge succeeds without conflicts then
> it clearly doesn't "need to materialize a working tree file", so it
> should NOT clear the skip_worktree flag for that path.
That is not at all implied by what I wrote, though.

If it can be done without too much effort, then it certainly is nicer to keep the sparseness when we do not have to materialize the working tree file. But at least in my mind, if it needs too many special cases, hacks, and conditionals, then it is not worth the complexity---if it is easier to write a correct code by allowing Git to populate working tree files, it is perfectly fine to do so.

In a sense, the sparse checkout "feature" itself is a hack by itself, and that is why I think this part should be "best effort" as well.

Previous: Elijah NewrenNext: Elijah Newren
Message 5 of 22 in “[BUG] merge-recursive overly aggressive when skipping updating the working tree”
  1. Ben PeartJul 20, 2018
  2. Elijah NewrenJul 20, 2018
  3. Junio C HamanoJul 20, 2018
  4. Elijah NewrenJul 20, 2018
  5. Junio C HamanoJul 20, 2018
  6. Elijah NewrenJul 20, 2018
  7. Ben PeartJul 23, 2018
  8. 0/2 Preserve skip_worktree bit in merges when necessaryElijah Newren, Jul 21, 2018
  9. 1/2 t3507: add a testcase showing failure with sparse checkoutElijah Newren, Jul 21, 2018
  10. Eric SunshineJul 21, 2018
  11. Ben PeartJul 23, 2018
  12. Eric SunshineJul 23, 2018
  13. Ben PeartJul 23, 2018
  14. Ben PeartJul 21, 2018
  15. Junio C HamanoJul 23, 2018
  16. 2/2 merge-recursive: preserve skip_worktree bit when necessaryElijah Newren, Jul 21, 2018
  17. Ben PeartJul 23, 2018
  18. 0/2 Preserve skip_worktree bit in merges when necessaryBen Peart, Jul 27, 2018
  19. 1/2 t3507: add a testcase showing failure with sparse checkoutBen Peart, Jul 27, 2018
  20. 2/2 merge-recursive: preserve skip_worktree bit when necessaryBen Peart, Jul 27, 2018
  21. Junio C HamanoJul 27, 2018
  22. Elijah NewrenJul 31, 2018

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.