<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/mergetools/vimdiff, branch v2.45.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.45.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.45.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2024-02-19T16:45:14Z</updated>
<entry>
<title>mergetools: vimdiff: use correct tool's name when reading mergetool config</title>
<updated>2024-02-19T16:45:14Z</updated>
<author>
<name>Kipras Melnikovas</name>
<email>kipras@kipras.org</email>
</author>
<published>2024-02-17T16:27:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b21d164275b9186421ebe39498be47ea9f171694'/>
<id>urn:sha1:b21d164275b9186421ebe39498be47ea9f171694</id>
<content type='text'>
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 &lt;kipras@kipras.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: simplify tabfirst</title>
<updated>2022-08-10T19:39:39Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=34133d9658a079b15af97c7c11d22939719e302d'/>
<id>urn:sha1:34133d9658a079b15af97c7c11d22939719e302d</id>
<content type='text'>
If we wrap the tabdo command there's no need for a separate command
call.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: fix single window layouts</title>
<updated>2022-08-10T19:39:35Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:17Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b6014eeac0963ccad3f769fc6cdd09a4a64f478d'/>
<id>urn:sha1:b6014eeac0963ccad3f769fc6cdd09a4a64f478d</id>
<content type='text'>
Layouts with a single window other than "MERGED" do not work (e.g.
"LOCAL" or "MERGED+LOCAL").

This is because as the documentation of bufdo says:

    The last buffer (or where an error occurred) becomes the current
    buffer.

And we do always do bufdo the end.

Additionally, we do it only once, when it should be per tab.

Fix this by doing it once per tab right after it's created and before
any buffer is switched.

Cc: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: rework tab logic</title>
<updated>2022-08-10T19:39:32Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:16Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=ffcc33f6a6923ade435a65d6cba751b3b95e6fd8'/>
<id>urn:sha1:ffcc33f6a6923ade435a65d6cba751b3b95e6fd8</id>
<content type='text'>
If we treat tabs especially, the logic becomes much simpler.

Cc: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: fix for diffopt</title>
<updated>2022-08-10T19:39:28Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:15Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=60184ab4d3c7fa56a721236e53aa957226bd399f'/>
<id>urn:sha1:60184ab4d3c7fa56a721236e53aa957226bd399f</id>
<content type='text'>
When diffopt has hiddenoff set and there's only one window (as is the
case in the single window mode) the diff mode is turned off.

We don't want that, so turn that option off.

Cc: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: silence annoying messages</title>
<updated>2022-08-10T19:39:24Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:14Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=66dd83ad09bce1d4234f853a004c2d22d485fd84'/>
<id>urn:sha1:66dd83ad09bce1d4234f853a004c2d22d485fd84</id>
<content type='text'>
When using the single window mode we are greeted with the following
warning:

  "./content_LOCAL_8975" 6L, 28B
  "./content_BASE_8975" 6 lines, 29 bytes
  "./content_REMOTE_8975" 6 lines, 29 bytes
  "content" 16 lines, 115 bytes
  Press ENTER or type command to continue

every time.

Silence that.

Suggested-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: make vimdiff3 actually work</title>
<updated>2022-08-10T19:39:17Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=79db50d82103dcf64cb379eb08074ebb5d66c2d1'/>
<id>urn:sha1:79db50d82103dcf64cb379eb08074ebb5d66c2d1</id>
<content type='text'>
When vimdiff3 was added in 7c147b77d3 (mergetools: add vimdiff3 mode,
2014-04-20), the description made clear the intention:

    It's similar to the default, except that the other windows are
    hidden.  This ensures that removed/added colors are still visible on
    the main merge window, but the other windows not visible.

However, in 0041797449 (vimdiff: new implementation with layout support,
2022-03-30) this was broken by generating a command that never creates
windows, and therefore vim never shows the diff.

The layout support implementation broke the whole purpose of vimdiff3,
and simply shows MERGED, which is no different from simply opening the
file with vim.

In order to show the diff, the windows need to be created first, and
then when they are hidden the diff remains (if hidenoff isn't set), but
by setting the `hidden` option the initial buffers are marked as hidden
thus making the feature work.

Suggested-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: vimdiff: fix comment</title>
<updated>2022-08-10T19:39:07Z</updated>
<author>
<name>Felipe Contreras</name>
<email>felipe.contreras@gmail.com</email>
</author>
<published>2022-08-10T15:46:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=d619183710718cbcb22b0d56956c033ce1f714bc'/>
<id>urn:sha1:d619183710718cbcb22b0d56956c033ce1f714bc</id>
<content type='text'>
The name of the variable is wrong, and it can be set to anything, like
1.

Signed-off-by: Felipe Contreras &lt;felipe.contreras@gmail.com&gt;
Reviewed-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'fr/vimdiff-layout-fix' into maint</title>
<updated>2022-07-27T20:00:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-07-27T20:00:28Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0263e6bc037058f5acd70f70ecfbe7137012fd12'/>
<id>urn:sha1:0263e6bc037058f5acd70f70ecfbe7137012fd12</id>
<content type='text'>
Recent update to vimdiff layout code has been made more robust
against different end-user vim settings.
source: &lt;20220708181024.45839-1-greenfoo@u92.eu&gt;

* fr/vimdiff-layout-fix:
  vimdiff: make layout engine more robust against user vim settings
</content>
</entry>
<entry>
<title>Merge branch 'js/vimdiff-quotepath-fix' into maint</title>
<updated>2022-07-27T20:00:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2022-07-27T20:00:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=57fe0df8a6295bc633f9fc4d2fa941900d9c109e'/>
<id>urn:sha1:57fe0df8a6295bc633f9fc4d2fa941900d9c109e</id>
<content type='text'>
Variable quoting fix in the vimdiff driver of "git mergetool"
source: &lt;pull.1287.v2.git.1657809063728.gitgitgadget@gmail.com&gt;

* js/vimdiff-quotepath-fix:
  mergetool(vimdiff): allow paths to contain spaces again
</content>
</entry>
</feed>
