<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/mergetools/vimdiff, branch v2.37.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.37.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.37.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2022-07-27T20:00:28Z</updated>
<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>
<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='http://git.kilabit.info/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>
<entry>
<title>vimdiff: make layout engine more robust against user vim settings</title>
<updated>2022-07-08T20:15:50Z</updated>
<author>
<name>Fernando Ramos</name>
<email>greenfoo@u92.eu</email>
</author>
<published>2022-07-08T18:10:24Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=f3d7623a13566048c4a48b9db6bb09765588a735'/>
<id>urn:sha1:f3d7623a13566048c4a48b9db6bb09765588a735</id>
<content type='text'>
'vim' has two configuration options ('splitbelow' and 'splitright') that
change the way the 'split' command behaves. When they are set, the
commands that the layout engine generates no longer work as expected.

In order to fix this we can append special keyword 'leftabove' to each
'split' and 'vertical split' subcommand found inside the command string
generated by the layout engine.

This works because whatever comes after 'leftabove' will temporally
ignore settings 'splitbelow' and 'splitright'.

Reported-by: Matthew Klein &lt;mklein994@gmail.com&gt;
Signed-off-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>vimdiff: add tool documentation</title>
<updated>2022-04-03T22:09:52Z</updated>
<author>
<name>Fernando Ramos</name>
<email>greenfoo@u92.eu</email>
</author>
<published>2022-03-30T19:19:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=7b5cf8be180940ce099c8413d02fb5707d900708'/>
<id>urn:sha1:7b5cf8be180940ce099c8413d02fb5707d900708</id>
<content type='text'>
Running 'git {merge,diff}tool --tool-help' now also prints usage
information about the vimdiff tool (and its variants) instead of just
its name.

Two new functions ('diff_cmd_help()' and 'merge_cmd_help()') have been
added to the set of functions that each merge tool (ie. scripts found
inside "mergetools/") can overwrite to provided tool specific
information.

Right now, only 'mergetools/vimdiff' implements these functions, but
other tools are encouraged to do so in the future, specially if they
take configuration options not explained anywhere else (as it is the
case with the 'vimdiff' tool and the new 'layout' option)

Note that the function 'show_tool_names', used in the implementation of
'git mergetool --tool-help', is also used in Documentation/Makefile to
generate the list of allowed values for the configuration variables
'{diff,merge}.{gui,}tool'. Adjust the rule so its output is an Asciidoc
"description list" instead of a plain list, with the tool name as the
item and the newly added tool description as the description.

In addition, a section has been added to
"Documentation/git-mergetool.txt" to explain the new "layout"
configuration option with examples.

Helped-by: Philippe Blain &lt;levraiphilippeblain@gmail.com&gt;
Signed-off-by: Fernando Ramos &lt;greenfoo@u92.eu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>vimdiff: new implementation with layout support</title>
<updated>2022-03-30T20:15:42Z</updated>
<author>
<name>Fernando Ramos</name>
<email>greenfoo@u92.eu</email>
</author>
<published>2022-03-30T19:19:06Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=0041797449da61f4131bb1673fa5d4c3af48240d'/>
<id>urn:sha1:0041797449da61f4131bb1673fa5d4c3af48240d</id>
<content type='text'>
When running 'git mergetool -t vimdiff', a new configuration option
('mergetool.vimdiff.layout') can now be used to select how the user
wants the different windows, tabs and buffers to be displayed.

If the option is not provided, the layout will be the same one that was
being used before this commit (ie. two rows with LOCAL, BASE and COMMIT
in the top one and MERGED in the bottom one).

The 'vimdiff' variants ('vimdiff{1,2,3}') still work but, because they
represented nothing else than different layouts, are now internally
implemented as a subcase of 'vimdiff' with the corresponding
pre-configured 'layout'.

Again, if you don't set "mergetool.vimdiff.layout" everything will work
the same as before *but* the arguments used to call {n,g,}vim will be
others (even if you don't/shouldn't notice it):

  - git mergetool -t vimdiff

    &gt; Before this commit:
      {n,g,}vim -f -d -c '4wincmd w | wincmd J' $LOCAL $BASE $REMOTE $MERGED

    &gt; After this commit:
      {n,g,}vim -f -c "echo | split | vertical split | 1b | wincmd l | vertical split | 2b | wincmd l | 3b | wincmd j | 4b | tabdo windo diffthis" -c "tabfirst" $LOCAL $BASE $REMOTE $MERGED

  - git mergetool -t vimdiff1

    &gt; Before this commit:
      {n,g,}vim -f -d -c 'echon "..."' $LOCAL $REMOTE

    &gt; After this commit:
      {n,g,}vim -f -c "echo | vertical split | 1b | wincmd l | 3b | tabdo windo diffthis" -c "tabfirst" $LOCAL $BASE $REMOTE $MERGED

  - git mergetool -t vimdiff2

    &gt; Before this commit:
      {n,g,}vim -f -d -c 'wincmd l' $LOCAL $MERGED $REMOTE

    &gt; After this commit:
      {n,g,}vim -f -c "echo | vertical split | 1b | wincmd l | vertical split | 4b | wincmd l | 3b | tabdo windo diffthis" -c "tabfirst" $LOCAL $BASE $REMOTE $MERGED

  - git mergetool -t vimdiff3

    &gt; Before this commit:
      {n,g,}vim -f -d -c 'hid | hid | hid' $LOCAL $REMOTE $BASE $MERGED

    &gt; After this commit:
      {n,g,}vim -f -c "echo | 4b | bufdo diffthis" -c "tabfirst" $LOCAL $BASE $REMOTE $MERGED

Despite being different, I have manually verified that they generate the same
layout as before.

Signed-off-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: add vimdiff1 merge tool variant</title>
<updated>2021-02-23T19:37:13Z</updated>
<author>
<name>Seth House</name>
<email>seth@eseth.com</email>
</author>
<published>2021-02-14T02:28:40Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=30bb8088afd4502acd2e166ddf7e4b071e53b86d'/>
<id>urn:sha1:30bb8088afd4502acd2e166ddf7e4b071e53b86d</id>
<content type='text'>
This adds yet another vimdiff/gvimdiff variant and presents conflicts as
a two-way diff between 'LOCAL' and 'REMOTE'. 'MERGED' is not opened
which deviates from the norm so usage text is echoed as a Vim message on
startup that instructs the user with how to proceed and how to abort.

Vimdiff is well-suited to two-way diffs so this is an option for a more
simple, more streamlined conflict resolution. For example: it is
difficult to communicate differences across more than two files using
only syntax highlighting; default vimdiff commands to get and put
changes between buffers do not need the user to manually specify
a source or destination buffer when only using two buffers.

Like other merge tools that directly compare 'LOCAL' with 'REMOTE', this
tool will benefit when paired with the new `mergetool.hideResolved`
setting.

Signed-off-by: Seth House &lt;seth@eseth.com&gt;
Tested-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools: add support for nvimdiff (neovim) family</title>
<updated>2020-07-29T21:44:49Z</updated>
<author>
<name>pudinha</name>
<email>rogi@skylittlesystem.org</email>
</author>
<published>2020-07-29T21:31:13Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=11868978c7c80d3c29071b29e7964e3d62523819'/>
<id>urn:sha1:11868978c7c80d3c29071b29e7964e3d62523819</id>
<content type='text'>
Signed-off-by: pudinha &lt;rogi@skylittlesystem.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetool--lib: improve support for vimdiff-style tool variants</title>
<updated>2020-07-29T21:44:46Z</updated>
<author>
<name>pudinha</name>
<email>rogi@skylittlesystem.org</email>
</author>
<published>2020-07-29T21:31:12Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=83bbf9b92ea8a10a60f44369a200b39ce5db78cd'/>
<id>urn:sha1:83bbf9b92ea8a10a60f44369a200b39ce5db78cd</id>
<content type='text'>
The merge tools vimdiff2, vimdiff3, gvimdiff2, gvimdiff3 and bc3 are all
variants of the main tools vimdiff and bc. They are implemented in the
main and a one-liner script that just sources it exist for each.

Allow variants ending in [0-9] to be correctly wired without the need
for such one-liners, so instead of 5 scripts, only 1 (gvimdiff) is
needed.

Signed-off-by: pudinha &lt;rogi@skylittlesystem.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>mergetools/vimdiff: trust Vim's exit code</title>
<updated>2016-11-29T18:57:41Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-11-29T09:38:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2967284456e9053ee8dd26148c22432a4776a3dc'/>
<id>urn:sha1:2967284456e9053ee8dd26148c22432a4776a3dc</id>
<content type='text'>
Allow vimdiff users to signal that they do not want to use the
result of a merge by exiting with ":cquit", which tells Vim to
exit with an error code.

This is better than the current behavior because it allows users
to directly flag that the merge is bad, using a standard Vim
feature, rather than relying on a timestamp heuristic that is
unforgiving to users that save in-progress merge files.

The original behavior can be restored by configuring
mergetool.vimdiff.trustExitCode to false.

Reported-by: Dun Peal &lt;dunpealer@gmail.com&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
