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

Re: [RFC/PATCH] mergetool: use resolved conflicts in all the views

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 17, 2020, 10:35 UTC
Message-ID
<5fdb3471c6bb7_d6d032087@natae.notmuch>
In-Reply-To
<20201217094424.GA75257@ellen>
Seth House wrote:
Show 24 quoted lines
> On Thu, Dec 17, 2020 at 08:35:21AM +0100, Johannes Sixt wrote:
> > Where's WinMerge in your list?
> 
> Added. Thanks for the suggestion; I wasn't familiar with it. Let me know
> if I missed anything in my (quick) assessment. The "auto-merge" function
> does indeed produce similar results to Felipe's patch.
> 
> > I would say that this is a hint that post-processing should
> > be moved to the tool drivers, and should not be done at the proposed level.
> 
> That was my thought as well and it didn't occur to me to raise
> a discussion here. However Felipe made the good point that adding this
> functionality in upstream Git would have immediate downstream effects
> for most tools. Almost every mergetool I've surveyed so far simply
> blindly shows a diff betweeen LOCAL and REMOTE (and sometimes BASE and
> sometimes MERGED) and Felipe's patch would have an immediate benefit for
> all those tools.
> 
> There are a few notable exceptions that have their own, internal
> conflict resolution logic -- tkdiff, WinMerge, and (I think) IntelliJ.
> And only two tools make direct use of the conflict resolution that Git
> already performed to produce MERGED -- Emacs+Magit, and diffconflicts.
> Those tools would have to make a decision whether to opt-in to the
> autoMerge flag or not.

Each tool would have to be evaluated individually, but at least from what I can see your tool--diffconflicts--shows exactly the same diff with or without my patch, and the `mergetool.automerge` configuration. It's only the DiffConflictsShowHistory command (which is secondary functionality, that you didn't even mention in your blog) that gets affected.

So, yes; *some* behavior is affected, but in my opinion not in a negative way.

In my view the whole point of "git mergetool" is to resolve conflicts, so if git can resolve conflicts *before* launching the mergetool, it should (whether it's rerere or automerge).

Show 5 quoted lines
> I did not initially like Felipe's patch because I personally want my
> mergetool to use all five of LOCAL, REMOTE, BASE, _and_ the two split
> halves of MERGED. However the pragmatism of it is growing on me. Because
> so many mergetools do simply diff LOCAL and REMOTE this one, simple
> opt-in would positively benefit all of them.

Yes. But other people may want to see the secondary functionality of your DiffConflictsShowHistory command with simplified conflicts, and those people can enable the option.

If you want to see the original LOCAL, REMOTE, and BASE, you can turn off that option (or simply never turn it on).

With the option everyone can have what they want.

I for example can keep using `gvimdiff3`, except with simpler diff chunks, thanks to your idea.

And for the record; "git mergetool" is one of of those things that you setup once, and forget about it. My fingers have been trained for more than a decade (maybe two) on exactly the same configuration, and I initially didn't think you were onto something.

It's really good that you did setup a test repository with a merge conflict that showcased the different situations one might encounter. It immediately became clear to me that you were indeed onto something.

So I give you full credit for the idea, and explaining it succinctly, that's in the commit message. I just found a way to shove it directly into "git mergetool".

Cheers.
-- 
Felipe Contreras
Previous: Seth HouseNext: Seth House
Message 11 of 70 in “mergetool: use resolved conflicts in all the views”
  1. mergetool: use resolved conflicts in all the viewsFelipe Contreras, Dec 16, 2020
  2. Junio C HamanoDec 16, 2020
  3. Seth HouseDec 16, 2020
  4. Junio C HamanoDec 17, 2020
  5. Felipe ContrerasDec 17, 2020
  6. Johannes SixtDec 17, 2020
  7. Felipe ContrerasDec 17, 2020
  8. Johannes SixtDec 17, 2020
  9. Felipe ContrerasDec 18, 2020
  10. Seth HouseDec 17, 2020
  11. Felipe ContrerasDec 17, 2020
  12. Seth HouseDec 17, 2020
  13. Junio C HamanoDec 17, 2020
  14. Felipe ContrerasDec 18, 2020
  15. Felipe ContrerasDec 18, 2020
  16. Seth HouseDec 18, 2020
  17. Felipe ContrerasDec 18, 2020
  18. Seth HouseDec 18, 2020
  19. Felipe ContrerasDec 18, 2020
  20. Seth HouseDec 19, 2020
  21. Felipe ContrerasDec 19, 2020
  22. Junio C HamanoDec 19, 2020
  23. Felipe ContrerasDec 19, 2020
  24. Junio C HamanoDec 19, 2020
  25. Felipe ContrerasDec 19, 2020
  26. Seth HouseDec 21, 2020
  27. Felipe ContrerasDec 21, 2020
  28. Seth HouseDec 21, 2020
  29. Felipe ContrerasDec 21, 2020
  30. David AguilarDec 21, 2020
  31. Code of conduct violation?Felipe Contreras, Dec 21, 2020
  32. Junio C HamanoDec 22, 2020
  33. Felipe ContrerasDec 22, 2020
  34. Pratyush YadavDec 22, 2020
  35. Felipe ContrerasDec 23, 2020
  36. Junio C HamanoDec 23, 2020
  37. Felipe ContrerasDec 23, 2020
  38. Nobody is THE one making contributionJunio C Hamano, Dec 23, 2020
  39. Felipe ContrerasDec 23, 2020
  40. Junio C HamanoDec 23, 2020
  41. Felipe ContrerasDec 24, 2020
  42. Ævar Arnfjörð BjarmasonDec 24, 2020
  43. Felipe ContrerasDec 24, 2020
  44. Ævar Arnfjörð BjarmasonDec 24, 2020
  45. Felipe ContrerasDec 24, 2020
  46. Junio C HamanoDec 24, 2020
  47. Felipe ContrerasDec 27, 2020
  48. Junio C HamanoDec 27, 2020
  49. Felipe ContrerasDec 27, 2020
  50. Junio C HamanoDec 28, 2020
  51. Felipe ContrerasDec 28, 2020
  52. Randall S. BeckerDec 24, 2020
  53. Felipe ContrerasDec 24, 2020
  54. Junio C HamanoDec 24, 2020
  55. David AguilarDec 24, 2020
  56. Felipe ContrerasDec 24, 2020
  57. Junio C HamanoDec 18, 2020
  58. Felipe ContrerasDec 18, 2020
  59. Junio C HamanoDec 19, 2020
  60. Felipe ContrerasDec 19, 2020
  61. David AguilarDec 20, 2020
  62. Felipe ContrerasDec 20, 2020
  63. David AguilarDec 20, 2020
  64. Felipe ContrerasDec 21, 2020
  65. Seth HouseDec 19, 2020
  66. Felipe ContrerasDec 16, 2020
  67. Junio C HamanoDec 17, 2020
  68. Felipe ContrerasDec 17, 2020
  69. mergetool: use resolved conflicts in all the viewsFelipe Contreras, Dec 17, 2020
  70. Felipe ContrerasDec 21, 2020

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.