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

Re: [RFC/PATCH] Teach git mergetool to use custom commands defined at config time

From
Charles Bailey <charles@hashpling.org>
Date
Feb 17, 2008, 00:20 UTC
Message-ID
<20080217002029.GA504@hashpling.org>
In-Reply-To
<CD749541-1B3B-4EA7-82A5-0DFC67B953BE@zib.de>
On Sat, Feb 16, 2008 at 11:37:31PM +0100, Steffen Prohaska wrote:
Show 23 quoted lines
> 
> On Feb 16, 2008, at 7:53 PM, Charles Bailey wrote:
> 
> >Currently git mergetool is restricted to a set of commands defined
> >in the script. You can subvert the mergetool.<tool>.path to force
> >git mergetool to use a different command, but if you have a command
> >whose invocation syntax does not match one of the current tools then
> >you would have to write a wrapper script for it.
> >
> >[...]
> >
> >This is a preliminary patch which aims to make it easier to use
> >a.n.other 3-way merge tool with git-mergetool without either hacking
> >the source or writing a wrapper script for the tool.
> 
> Why not just add the tools you have in mind to git mergetool?  If
> everyone did that eventually we would have direct support for a
> rather long list of tools.  This would be the easiest solution
> for the end user: He could just choose the preferred tool and use
> it.  The invocation of each merge tool would be coded in
> mergetool.  The exact command line could be fine tuned and would
> be reviewed by other git developers.
> 

I have to disagree with this approach. I didn't actually have these tools in mind when I wrote the patch, I searched around for tools that I've used in the past and tools that I know that other people use. I had in mine the questions that I'd want to be able to answer when people ask me about git. It's not that the list will be large, it's that it will never be complete because there will always be tools that aren't globally available.

When I'm asked "can I use xyz visual merge tool" with git there will always be some xyz for which the tool isn't yet in the list. It's a lot more difficult to sell "patch the tool, submit the patch so it doesn't get lost in the next upgrade of git, oh and support the patch so that it does get integrated" than it is to sell "take the command line format, massage it and put it in your system/global config".

Show 12 quoted lines
> If you just integrated these tools directly I could use them
> right away instead of first reading the documentation of the
> custom mechanism and then looking up how to configure the right
> command line for the tool I want to use.  If the tools were
> directly integrated I could for example just say "git mergetool
> --tool=p4".
> 
> That does not mean I am opposed to adding a mechanism for
> handling custom tools.  But easier for the end user would be
> if the tools were directly integrated.
> 
> 		Steffen

Sure, it's nice when the tool you want is already integrated but the list is never going to be perfect. This patch was designed to support the fallback position: OK, my tool isn't natively supported, how easily can I get it working?

I don't believe that git installs a system config by default, but one idea I had was to rip out all of the native tools support in git mergetool and replace it with a list of predefined custom tools configs. This would put all merge tools on an equal footing and should make extra tool support patches simpler and easier to integrate. This doesn't have any legs without a system default config, though.

Charles.
Previous: Steffen ProhaskaNext: Johannes Schindelin
Message 6 of 16 in “Teach git mergetool to use custom commands defined at config time”
  1. Teach git mergetool to use custom commands defined at config timeCharles Bailey, Feb 16, 2008
  2. Junio C HamanoFeb 16, 2008
  3. Charles BaileyFeb 16, 2008
  4. Jakub NarebskiFeb 16, 2008
  5. Steffen ProhaskaFeb 16, 2008
  6. Charles BaileyFeb 17, 2008
  7. Johannes SchindelinFeb 17, 2008
  8. Charles BaileyFeb 17, 2008
  9. Junio C HamanoFeb 17, 2008
  10. Steffen ProhaskaFeb 17, 2008
  11. Charles BaileyFeb 17, 2008
  12. Theodore TsoFeb 17, 2008
  13. Charles BaileyFeb 17, 2008
  14. Charles BaileyFeb 17, 2008
  15. Junio C HamanoFeb 18, 2008
  16. Charles BaileyFeb 18, 2008

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.