git/mergetools
Kipras Melnikovas b21d164275 mergetools: vimdiff: use correct tool's name when reading mergetool config
The /mergetools/vimdiff script, which handles both vimdiff, nvimdiff
and gvimdiff mergetools (the latter 2 simply source the vimdiff script), has a
function merge_cmd() which read the layout variable from git config, and it
would always read the value of mergetool.**vimdiff**.layout, instead of the
mergetool being currently used (vimdiff or nvimdiff or gvimdiff).

It looks like in 7b5cf8be18 (vimdiff: add tool documentation, 2022-03-30),
we explained the current behavior in Documentation/config/mergetool.txt:

```
mergetool.vimdiff.layout::
	The vimdiff backend uses this variable to control how its split
	windows look like. Applies even if you are using Neovim (`nvim`) or
	gVim (`gvim`) as the merge tool. See BACKEND SPECIFIC HINTS section
```

which makes sense why it's explained this way - the vimdiff backend is used by
gvim and nvim. But the mergetool's configuration should be separate for each tool,
and indeed that's confirmed in same commit at Documentation/mergetools/vimdiff.txt:

```
Variants

Instead of `--tool=vimdiff`, you can also use one of these other variants:
  * `--tool=gvimdiff`, to open gVim instead of Vim.
  * `--tool=nvimdiff`, to open Neovim instead of Vim.

When using these variants, in order to specify a custom layout you will have to
set configuration variables `mergetool.gvimdiff.layout` and
`mergetool.nvimdiff.layout` instead of `mergetool.vimdiff.layout`
```

So it looks like we just forgot to update the 1 part of the vimdiff script
that read the config variable. Cheers.

Though, for backward compatibility, I've kept the mergetool.vimdiff
fallback, so that people who unknowingly relied on it, won't have their
setup broken now.

Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-02-19 08:45:14 -08:00
..
araxis mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
bc mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
codecompare mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
deltawalker mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
diffmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
diffuse mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
ecmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
emerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
examdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
guiffy mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
gvimdiff mergetools: simplify how we handle "vim" and "defaults" 2013-01-28 19:00:38 -08:00
kdiff3 mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
kompare mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
meld mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
nvimdiff mergetools: add support for nvimdiff (neovim) family 2020-07-29 14:44:49 -07:00
opendiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
p4merge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
smerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
tkdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
tortoisemerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
vimdiff mergetools: vimdiff: use correct tool's name when reading mergetool config 2024-02-19 08:45:14 -08:00
winmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
xxdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00