<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/mergetools, branch v2.40.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.40.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.40.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2022-08-10T19:39:39Z</updated>
<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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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='https://git.shady.money/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>
<entry>
<title>mergetool(vimdiff): allow paths to contain spaces again</title>
<updated>2022-07-14T17:37:44Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2022-07-14T14:31:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ccc7b5148bdd9deb33f3cfa5a872a74634105021'/>
<id>urn:sha1:ccc7b5148bdd9deb33f3cfa5a872a74634105021</id>
<content type='text'>
In 0041797449d (vimdiff: new implementation with layout support,
2022-03-30), we introduced a completely new implementation of the
`vimdiff` backend for `git mergetool`.

In this implementation, we no longer call `vim` directly but we
accumulate in the variable `FINAL_CMD` an arbitrary number of commands
for `vim` to execute, which necessitates the use of `eval` to split the
commands properly into multiple command-line arguments.

That same `eval` command also needs to pass the paths to `vim`, and
while it looks as if they are quoted correctly, that quoting only
reaches the `eval` instruction and is lost after that, therefore paths
that contain whitespace characters (or other characters that are
interpreted by the POSIX shell) are handled incorrectly.

This is a simple reproducer:

	git init -b main bam-merge-fail
	cd bam-merge-fail
	echo a&gt;"a file.txt"
	git add "a file.txt"
	git commit -m "added 'a file.txt'"
	echo b&gt;"a file.txt"
	git add "a file.txt"
	git commit -m "diverged b 'a file.txt'"
	git checkout -b c HEAD~
	echo c&gt;"a file.txt"
	git add "a file.txt"
	git commit -m "diverged c 'a file.txt'"
	git checkout main
	git merge c
	git mergetool --tool=vimdiff

With Git v2.37.0/v2.37.1, this will open 7 buffers, not four, and not
display the correct contents at all.

To fix this, let's not expand the variables containing the path
parameters before passing them to the `eval` command, but let that
command expand the variables instead.

This fixes https://github.com/git-for-windows/git/issues/3945

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
