git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] mergetools: add vimdiff3 mode

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2014, 17:30 UTC
Message-ID
<xmqq7g6h6zm3.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20140422050142.GB60610@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 11 quoted lines
> On Sun, Apr 20, 2014 at 07:24:20PM -0500, Felipe Contreras wrote:
>> 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.
>> 
>> Specially useful with merge.conflictstyle=diff3.
>
> This is a nice addition, thanks.
>
> FWIW,
> Acked-by: David Aguilar <davvid@gmail.com>
Thanks for an explicit Ack.

I personally think a new backend vimdiff3 can go in 2.0 (though we are -rc0), as we can read from the patch below, it is very unlikely to break anything else (I am not sure what these 'hid' are in the implementation, but even if we had any breakage there, it would not affect anybody other than vimdiff3 backend).

Show 66 quoted lines
>> 
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>> 
>> How a conflict looks:
>> http://felipec.org/vimdiff3-conflict.png
>> 
>> How it looks resolved:
>> http://felipec.org/vimdiff3-resolved.png
>> 
>>  mergetools/gvimdiff3 |  1 +
>>  mergetools/vimdiff   | 14 ++++++++++++--
>>  mergetools/vimdiff3  |  1 +
>>  3 files changed, 14 insertions(+), 2 deletions(-)
>>  create mode 100644 mergetools/gvimdiff3
>>  create mode 100644 mergetools/vimdiff3
>> 
>> diff --git a/mergetools/gvimdiff3 b/mergetools/gvimdiff3
>> new file mode 100644
>> index 0000000..04a5bb0
>> --- /dev/null
>> +++ b/mergetools/gvimdiff3
>> @@ -0,0 +1 @@
>> +. "$MERGE_TOOLS_DIR/vimdiff"
>> diff --git a/mergetools/vimdiff b/mergetools/vimdiff
>> index 39d0327..1ddfbfc 100644
>> --- a/mergetools/vimdiff
>> +++ b/mergetools/vimdiff
>> @@ -20,16 +20,26 @@ merge_cmd () {
>>  		"$merge_tool_path" -f -d -c 'wincmd l' \
>>  			"$LOCAL" "$MERGED" "$REMOTE"
>>  		;;
>> +	gvimdiff3|vimdiff3)
>> +		if $base_present
>> +		then
>> +			"$merge_tool_path" -f -d -c 'hid | hid | hid' \
>> +				"$LOCAL" "$REMOTE" "$BASE" "$MERGED"
>> +		else
>> +			"$merge_tool_path" -f -d -c 'hid | hid' \
>> +				"$LOCAL" "$REMOTE" "$MERGED"
>> +		fi
>> +		;;
>>  	esac
>>  	check_unchanged
>>  }
>>  
>>  translate_merge_tool_path() {
>>  	case "$1" in
>> -	gvimdiff|gvimdiff2)
>> +	gvimdiff|gvimdiff2|gvimdiff3)
>>  		echo gvim
>>  		;;
>> -	vimdiff|vimdiff2)
>> +	vimdiff|vimdiff2|vimdiff3)
>>  		echo vim
>>  		;;
>>  	esac
>> diff --git a/mergetools/vimdiff3 b/mergetools/vimdiff3
>> new file mode 100644
>> index 0000000..04a5bb0
>> --- /dev/null
>> +++ b/mergetools/vimdiff3
>> @@ -0,0 +1 @@
>> +. "$MERGE_TOOLS_DIR/vimdiff"
>> -- 
>> 1.9.2+fc1.1.g5c924db
Previous: David Aguilar
Message 3 of 3 in “mergetools: add vimdiff3 mode”
  1. mergetools: add vimdiff3 modeFelipe Contreras, Apr 21, 2014
  2. David AguilarApr 22, 2014
  3. Junio C HamanoApr 22, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.