git-commit-vandalism/mergetools
Fernando Ramos 0041797449 vimdiff: new implementation with layout support
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

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

    > 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

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

    > 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

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

    > 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

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

    > 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 <greenfoo@u92.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2022-03-30 13:15:42 -07:00
..
araxis mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
bc mergetools/bc: add bc4 to the alias list for Beyond Compare 2020-11-11 13:00:10 -08:00
codecompare mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
deltawalker mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
diffmerge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
diffuse mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
ecmerge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
emerge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
examdiff mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
guiffy mergetools: add support for guiffy 2018-04-06 08:11:39 +09:00
gvimdiff
kdiff3 mergetools/kdiff3: make kdiff3 work on Windows too 2021-06-08 10:26:16 +09:00
kompare mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
meld mergetool: allow auto-merge for meld to follow the vim-diff behavior 2020-09-16 17:11:20 -07:00
nvimdiff mergetools: add support for nvimdiff (neovim) family 2020-07-29 14:44:49 -07:00
opendiff mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
p4merge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
smerge mergetools: add support for smerge (Sublime Merge) 2019-04-04 18:21:25 +09:00
tkdiff mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
tortoisemerge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
vimdiff vimdiff: new implementation with layout support 2022-03-30 13:15:42 -07:00
winmerge mergetool: honor mergetool.$tool.trustExitCode for built-in tools 2016-11-29 10:54:03 -08:00
xxdiff mergetools/xxdiff: prevent segfaults from stopping difftool 2021-10-13 11:04:04 -07:00