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, 10:15 UTC
Message-ID
<20080217101538.GA21823@hashpling.org>
In-Reply-To
<FBA2E61E-5CAF-49E3-A917-ACDD10586928@zib.de>
On Sun, Feb 17, 2008 at 08:59:31AM +0100, Steffen Prohaska wrote:
Show 18 quoted lines
> On Feb 17, 2008, at 1:20 AM, Charles Bailey wrote:
> >>
> >>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.
> 
> ... but I am slightly opposed to this idea.  Note that at least
> in one case there is a trick needed to launch the tool.  Such a
> trick can easily be coded if the tool is directly added in
> "git mergetool"; but it would be much harder to capture by a
> generic mechanism via config variables.  The example I mean is
> opendiff that needs to be piped to cat (opendiff ... | cat).
> Otherwise opendiff detaches FileMerge and returns immediately
> without waiting for the user to complete the merge.

I just wanted to say that in my patch, as the configuration is a sub-shell, that it is perfectly possible to do this in a custom mergetool as well.

I have different reasons for not liking a default system config file, namely the whole customize vs. updgrade conflict issues.

An alternative that I have considered is to include a $(sharedir)/gitcore/mergetools.gitconfig which could contain the default native mergetool configs (both the commands and the 'trustExitCode' settings.

Submitting a new merge tool patch becomes a simple matter of: "I've used and tested this in my system (or global) gitconfig, please add to the git distribution mergetool.gitconfig."

I know that most git developers are just as at ease (if not more so) editing a git shell script as they are at using git config but I still believe that there is a significant group of users and potential users for whom there is an import barrier between configuring software and 'having' to hack it to get it to work.

Charles.
Previous: Steffen ProhaskaNext: Theodore Tso
Message 11 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.