Patchwork [STABLE] mergetools: vimdiff issue a warning explaining how to abort

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 15, 2013, 11:31 a.m.
Message ID <cabb74a6dc7a98b63f7e.1360927889@crater2.logilab.fr>
Download mbox | patch
Permalink /patch/1013/
State Superseded
Commit 6a012704c841db7d6c018b916465fab961610544
Headers show

Comments

Pierre-Yves David - Feb. 15, 2013, 11:31 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1360924084 -3600
# Branch stable
# Node ID cabb74a6dc7a98b63f7ea51b5b87fb613a8be940
# Parent  f6f35d646cb5919997d3a23b942594def5d9e243
mergetools: vimdiff issue a warning explaining how to abort

Adds a message displayed at each vimdiff invocation:

  merge conflict detected, type ":cq" to abort

Vimdiff is very confusing for non-vim user (not to speak about vim user confused
anyway. However it is very likely that vimdiff is picked as the mergetool of
choice when using the default config:
- vim is available on all UNIX system.
- Its one of the rare non graphical merge tools.
tonfa - Feb. 15, 2013, 12:21 p.m.
Looks good.


On Fri, Feb 15, 2013 at 12:31 PM, <pierre-yves.david@logilab.fr> wrote:

> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@logilab.fr>
> # Date 1360924084 -3600
> # Branch stable
> # Node ID cabb74a6dc7a98b63f7ea51b5b87fb613a8be940
> # Parent  f6f35d646cb5919997d3a23b942594def5d9e243
> mergetools: vimdiff issue a warning explaining how to abort
>
> Adds a message displayed at each vimdiff invocation:
>
>   merge conflict detected, type ":cq" to abort
>
> Vimdiff is very confusing for non-vim user (not to speak about vim user
> confused
> anyway. However it is very likely that vimdiff is picked as the mergetool
> of
> choice when using the default config:
> - vim is available on all UNIX system.
> - Its one of the rare non graphical merge tools.
>
> diff --git a/contrib/mergetools.hgrc b/contrib/mergetools.hgrc
> --- a/contrib/mergetools.hgrc
> +++ b/contrib/mergetools.hgrc
> @@ -13,11 +13,11 @@ gvimdiff.args=--nofork -d -g -O $local $
>  gvimdiff.regkey=Software\Vim\GVim
>  gvimdiff.regkeyalt=Software\Wow6432Node\Vim\GVim
>  gvimdiff.regname=path
>  gvimdiff.priority=-9
>
> -vimdiff.args=$local $other $base
> +vimdiff.args=$local $other $base -c 'echohl WarningMsg | echo "merge
> conflict detected, type \":cq\" to abort" | echohl'
>  vimdiff.check=changed
>  vimdiff.priority=-10
>
>  merge.check=conflicts
>  merge.priority=-100
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
Matt Mackall - Feb. 15, 2013, 8:08 p.m.
On Fri, 2013-02-15 at 13:21 +0100, Benoit Boissinot wrote:
> Looks good.

> > -vimdiff.args=$local $other $base
> > +vimdiff.args=$local $other $base -c 'echohl WarningMsg | echo "merge
> > conflict detected, type \":cq\" to abort" | echohl'

Actually, it's not so good. I get an otherwise blank screen that says:

 "smem" 676L, 20653C
 merge conflict detected, type ":cg" to abort
 Press ENTER or type command to continue

If I were an everyday vimdiff user[1], I would be pissed off by this
change in very short order. Especially if I were resolving 10 conflicts
in a row.

And if I were a NON-vimdiff user, I'd still have just about no idea what
just happened or how to avoid it in the future.

Whatever we do in this area, it MUST have negligible impact on people
who rely on vimdiff today.

What's needed here is a way to display something in the last line of the
display (command area?), like how Emacs prints

 For information about the GNU Project and its goals, type M-x describe-project.

before the first keystroke. That message should include the following
information:

- how to exit
- 'vimdiff' so people can Google
- 'merge conflict' so people can Google

Hopefully that Googling can take them to a page in our wiki that
explains how merge tools are configured and selected.

Also, I actually went down this path yesterday and discovered your
version is equivalent to:

-c ':echo "merge conflict..."'

I gave up after deciding this called for a vim expert.

[1] And thank god I'm not, because I seriously hate vi.

Patch

diff --git a/contrib/mergetools.hgrc b/contrib/mergetools.hgrc
--- a/contrib/mergetools.hgrc
+++ b/contrib/mergetools.hgrc
@@ -13,11 +13,11 @@  gvimdiff.args=--nofork -d -g -O $local $
 gvimdiff.regkey=Software\Vim\GVim
 gvimdiff.regkeyalt=Software\Wow6432Node\Vim\GVim
 gvimdiff.regname=path
 gvimdiff.priority=-9
 
-vimdiff.args=$local $other $base
+vimdiff.args=$local $other $base -c 'echohl WarningMsg | echo "merge conflict detected, type \":cq\" to abort" | echohl'
 vimdiff.check=changed
 vimdiff.priority=-10
 
 merge.check=conflicts
 merge.priority=-100