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

Re: Letting tools partially resolve conflicts in a file

From
Martin von Zweigbergk <martinvonz@gmail.com>
Date
Nov 24, 2021, 22:32 UTC
Message-ID
<CANiSa6iNmzKv_-6wH-LmbsRQKWiL3ZwTU5MKUZKzZR8xnMjGAg@mail.gmail.com>
In-Reply-To
<xmqqwnkx9p40.fsf@gitster.g>
On Wed, Nov 24, 2021 at 2:16 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
>
> Martin von Zweigbergk <martinvonz@gmail.com> writes:
>
> > The solution I had in mind for letting merge tools communicate partial
> > resolution was to let them take 3 inputs (as today) and produce 3
> > outputs (perhaps by overwriting its 3 inputs). That way they can leave
> > conflicts in a conflict-marker-agnostic way. ...
> >
> > Correct. My team at work hopes to create a language-aware mergetool.
> > The "#includes and imports" I mentioned is just one case that such a
> > tool could resolve. Hopefully it can also figure out cases like where
> > both sides modify an array (on a single line), or where an expression
> > is modified on one side and re-wrapped on the other. The thing is that
> > it will obviously not be able to handle *all* conflicts, so we want to
> > leave remaining conflicts for the user, so that's where this idea
> > comes in. I don't foresee having more than one such tool in the chain
> > before the user gets involved.
>
> Hmph, OK, so the part I guessed that more than one such tools are
> chained together was incorrect.  I do not find it too implausible to
> wish to first let the "include/import" tool to clean up the fallout
> of renaming the include/module files this source depends on, and
> then let the "renamed variable" tool to handle the fallout of
> renaming a local variable in a file in this source file, in this
> order or the other way around.  It may be a tall order to write a
> tool that can handle *all* coflicts, but it would be a nice future
> to see that multiple tools, each of which specializing one corner of
> its own, work well together.

Yep, I agree that it's desirable to allow multiple tools in the chain, even though we don't currently have any plans for more than one tool in it (plus the final "interactive" tool). And to be honest, we won't even be using Git (this project is done in the scope of Google's Mercurial-based tool). However, if the project to write a language-aware tool works out, it should of course also be useful for Git projects.

Previous: Junio C Hamano
Message 5 of 5 in “Letting tools partially resolve conflicts in a file”
  1. Martin von ZweigbergkNov 24, 2021
  2. Junio C HamanoNov 24, 2021
  3. Martin von ZweigbergkNov 24, 2021
  4. Junio C HamanoNov 24, 2021
  5. Martin von ZweigbergkNov 24, 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.