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

Re: [PATCH] Support nvim as mergetool

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 18, 2020, 20:30 UTC
Message-ID
<xmqqd04sbm6n.fsf@gitster.c.googlers.com>
In-Reply-To
<20200718192001.27434-1-rogi@skylittlesystem.org>
pudinha <rogi@skylittlesystem.org> writes:
Show 5 quoted lines
> ---
> Hello giters! Hope you are well!
>
> I made this little patch to support nvim as a merge tool. What do you
> think?
Uninspiring.
But that is not your fault.  

The way vimdiff, vimdiff2 and vimdiff3 waste one file for each just to have a different name is simply bad, and the way it was extended to cover gvimdiff family is even more horrible. This patch makes the existing mess even worse. That part is your fault, I'd have to say.

I'd rather see us explore ways to improve the current arrangement used to support these 6 variants before adding yet another 3 new ones.

For example, we could add another method the backends could define, call it list_tool_variants, and whenever the control flow goes from run_merge_tool through setup_tool for a tool whose name ends with [1-9], e.g. "foomerge3", we first see if there is "foomerge" tool and if there is ask it if it knows about "foomerge3" variant by calling its list_tool_variants.

That way, we probably can remove the files for vimdiff2, vimdiff3, gvimdiff2 and gvimdiff3 (gvimdiff needs to stay there, as we do not want to make the name derivation rule too complex) only to hold a single line ". vimdiff". Then the next person who adds yet another set of backends based on a yet another reimplementation or skin of vim would only have to add a single file in mergetools/ directory, not three.

Hmm?
Previous: pudinhaNext: pudinha
Message 2 of 10 in “Support nvim as mergetool”
  1. Support nvim as mergetoolpudinha, Jul 18, 2020
  2. Junio C HamanoJul 18, 2020
  3. 1/2 Refactor vimdiff and bc merge tool variantspudinha, Jul 19, 2020
  4. Junio C HamanoJul 20, 2020
  5. 0/2 Support nvim as merge toolpudinha, Jul 19, 2020
  6. 0/2 mergetools: add support for nvimdiff (neovim) familypudinha, Jul 29, 2020
  7. 1/2 mergetool--lib: improve support for vimdiff-style tool variantspudinha, Jul 29, 2020
  8. 2/2 mergetools: add support for nvimdiff (neovim) familypudinha, Jul 29, 2020
  9. 2/2 Support nvim as merge toolpudinha, Jul 19, 2020
  10. Junio C HamanoJul 20, 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.