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

Re: Optimizing writes to unchanged files during merges?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Apr 12, 2018, 23:35 UTC
Message-ID
<CA+55aFxA9YVLoh_23V8Hi+X7ODEmqg-dhdAYZz1jbq5JhXqBFw@mail.gmail.com>
In-Reply-To
<xmqqtvsg10bu.fsf@gitster-ct.c.googlers.com>
On Thu, Apr 12, 2018 at 4:17 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
>
> A bit of detour.  "Change in side branch happened to be a subset of
> the change in trunk and gets subsumed, but we end up writing the
> same result" happens also with the simpler resolve strategy.
>
> Here is a fix.

Heh. Except git-merge-one-file.sh is *only* used for that case, so this doesn't fix the normal case.

I verified that the normal case situation is that "update_file_flags()" thing that checks out the end result.

It's called by this case:
        } else if (a_oid && b_oid) {
                /* Case C: Added in both (check for same permissions) and */
                /* case D: Modified in both, but differently. */
                clean_merge = merge_content(o, path,
                                            o_oid, o_mode, a_oid,
a_mode, b_oid, b_mode,
                                            NULL);

in process_entry(), and I think we could just there add a test for if o_old,o_mod == a_oid,a_mode or something?

              Linus
Previous: Junio C HamanoNext: Linus Torvalds
Message 4 of 29 in “Optimizing writes to unchanged files during merges?”
  1. Linus TorvaldsApr 12, 2018
  2. Junio C HamanoApr 12, 2018
  3. Junio C HamanoApr 12, 2018
  4. Linus TorvaldsApr 12, 2018
  5. Linus TorvaldsApr 12, 2018
  6. Linus TorvaldsApr 12, 2018
  7. Linus TorvaldsApr 13, 2018
  8. Elijah NewrenApr 13, 2018
  9. Linus TorvaldsApr 13, 2018
  10. Stefan BellerApr 13, 2018
  11. Linus TorvaldsApr 13, 2018
  12. Elijah NewrenApr 13, 2018
  13. Junio C HamanoApr 13, 2018
  14. Junio C HamanoApr 16, 2018
  15. Linus TorvaldsApr 16, 2018
  16. Lars SchneiderApr 16, 2018
  17. Ævar Arnfjörð BjarmasonApr 16, 2018
  18. Lars SchneiderApr 17, 2018
  19. Jacob KellerApr 16, 2018
  20. Jacob KellerApr 16, 2018
  21. Junio C HamanoApr 16, 2018
  22. Lars SchneiderApr 17, 2018
  23. Jacob KellerApr 17, 2018
  24. Phillip WoodApr 16, 2018
  25. Stefan HallerApr 16, 2018
  26. Elijah NewrenApr 16, 2018
  27. Elijah NewrenApr 16, 2018
  28. Linus TorvaldsApr 12, 2018
  29. Elijah NewrenApr 13, 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.