Skip to content
Snippets Groups Projects
Select Git revision
  • 2c7b491c1d3107be35c375f59e040b0f13d0cc0c
  • master default protected
  • approxidate-tweaks
  • bulk-checkin-sign-compare-fix
  • v2.49.0
  • v2.49.0-rc2
  • v2.49.0-rc1
  • v2.49.0-rc0
  • v2.48.1
  • v2.48.0
  • v2.48.0-rc2
  • v2.48.0-rc1
  • v2.46.3
  • v2.40.4
  • v2.41.3
  • v2.42.4
  • v2.43.6
  • v2.44.3
  • v2.45.3
  • v2.47.2
  • v2.48.0-rc0
  • v2.47.1
  • v2.47.0
  • v2.47.0-rc1
24 results

mergetools

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Kipras Melnikovas authored and Junio C Hamano committed
    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 7b5cf8be (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: default avatarKipras Melnikovas <kipras@kipras.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b21d1642
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Name Last commit Last update
    ..