All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: David Aguilar <davvid@gmail.com>, Dickson Wong <dicksonwong@gmail.com>
Subject: Re: [PATCH] mergetool: reorder vim/gvim buffers in three-way diffs
Date: Wed, 10 Feb 2016 15:40:31 +0100	[thread overview]
Message-ID: <56BB4BDF.3010407@drmicha.warpmail.net> (raw)
In-Reply-To: <xmqqr3gl1pyw.fsf@gitster.mtv.corp.google.com>

Junio C Hamano venit, vidit, dixit 09.02.2016 23:25:
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Dickson Wong <dicksonwong@gmail.com> writes:
>>
>>> When invoking default (g)vimdiff three-way merge, the merged file is
>>> loaded as the first buffer but moved to the bottom as the fourth window.
>>> This causes a disconnect between vim commands that operate on window
>>> positions (e.g. CTRL-W_w) and those that operate on buffer index (e.g.
>>> do/dp).
>>>
>>> This change reorders the buffers to have the same index as windows while
>>> keeping the cursor default to the merged result as the bottom window.
>>>
>>> Signed-off-by: Dickson Wong <dicksonwong@gmail.com>
>>> ---
>>
>> David, I unfortunately do not use 'mergetools' myself and certainly
>> not vimdiff.
>>
>> Opinions?
> 
> Second call for help.  Any comments on this from anybody other than
> the author that I missed to support this change?
> 

OK, applied it (on top of next), looks sane and improves the situation
for the majority of people who read left to right, then top down and
assign buffers 1 2 3 4 "mentally" to local base remote merge windows
based on that. Their expectation is met now. Thanks!

(Also, the other vim variants don't need a corresponding change.)

Michael

>>
>>>  mergetools/vimdiff | 4 ++--
>>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/mergetools/vimdiff b/mergetools/vimdiff
>>> index 1ddfbfc..74ea6d5 100644
>>> --- a/mergetools/vimdiff
>>> +++ b/mergetools/vimdiff
>>> @@ -2,22 +2,22 @@ diff_cmd () {
>>>  	"$merge_tool_path" -R -f -d \
>>>  		-c 'wincmd l' -c 'cd $GIT_PREFIX' "$LOCAL" "$REMOTE"
>>>  }
>>>  
>>>  merge_cmd () {
>>>  	touch "$BACKUP"
>>>  	case "$1" in
>>>  	gvimdiff|vimdiff)
>>>  		if $base_present
>>>  		then
>>> -			"$merge_tool_path" -f -d -c 'wincmd J' \
>>> -				"$MERGED" "$LOCAL" "$BASE" "$REMOTE"
>>> +			"$merge_tool_path" -f -d -c '4wincmd w | wincmd J' \
>>> +				"$LOCAL" "$BASE" "$REMOTE" "$MERGED"
>>>  		else
>>>  			"$merge_tool_path" -f -d -c 'wincmd l' \
>>>  				"$LOCAL" "$MERGED" "$REMOTE"
>>>  		fi
>>>  		;;
>>>  	gvimdiff2|vimdiff2)
>>>  		"$merge_tool_path" -f -d -c 'wincmd l' \
>>>  			"$LOCAL" "$MERGED" "$REMOTE"
>>>  		;;
>>>  	gvimdiff3|vimdiff3)

  reply	other threads:[~2016-02-10 14:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-29  2:18 [PATCH] mergetool: reorder vim/gvim buffers in three-way diffs Dickson Wong
2016-01-29 18:45 ` Junio C Hamano
2016-02-09 22:25   ` Junio C Hamano
2016-02-10 14:40     ` Michael J Gruber [this message]
2016-02-10 17:45       ` Junio C Hamano
2016-02-11 15:44         ` Michael J Gruber
2016-02-11 16:03           ` Junio C Hamano
2016-02-11 19:24             ` Dickson Wong
2016-02-11 19:31               ` Junio C Hamano
2016-02-11 20:10                 ` Dickson Wong
2016-02-11 21:15             ` David Aguilar
2016-02-12 18:15               ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56BB4BDF.3010407@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=davvid@gmail.com \
    --cc=dicksonwong@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.