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

Suggestion for difftool behaviour during a merge conflict

From
Øystein Walle <oystwa@gmail.com>
Date
Mar 13, 2013, 18:48 UTC
Message-ID
<CAFaJEqu8gHSLK5u7v5ZOaJ1XjAhV=F9p46MEo2sDVH4vpXAojA@mail.gmail.com>

When a merge is ongoing and there are conflicts, 'git difftool' will output the exact same --cc-style diff output as 'git diff' will without further explanation. This has lead to some confusion: A couple of weeks ago a person asked on #git why his difftool wasn't working. After a long while we realized difftool's behaviour after invocations such as 'git difftool HEAD~ HEAD' would work as expected but 'git difftool' "simply wouldn't".

With that in mind I have three suggestions on improving 'git difftool':
 - Show a three-way diff between the versions (local, remote, merge)
   using the user's configured difftool. Diffing against the version
   containing the markers will generate some extra noise in the difftool
   and might be confusing, but it's similar in behaviour to how 'git
   difftool' normally works.
 - Prompt the user if they want to launch 'git mergetool' instead since
   a merge is ongoing. Reasonable but it might be awkward if the user is
   asked whether the conflict was resolved or not when all they wanted
   to do was to visually diff something.
 - Add a notice to stderr saying that a --cc-style diff output is shown
   instead; or document the behaviour in the man page. Definitely the
   simplest option.

I'm willing to try to take a stab at either of these but I wanted to bring it up first. There is of course an implicit fourth option which is to do nothing, and that I'm wrong about this :)

Best regards, Øystein Walle

Next: David Aguilar
Message 1 of 2 in “Suggestion for difftool behaviour during a merge conflict”
  1. Øystein WalleMar 13, 2013
  2. David AguilarMar 13, 2013

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.