Thursday, March 5, 2015

Re: [ann] New plugin to use patience diff algorithm for vim

Hi Ben!

On Do, 05 Mär 2015, Ben Fritz wrote:

> On Thursday, March 5, 2015 at 1:19:36 AM UTC-6, Christian Brabandt wrote:
> > On Do, 05 Mär 2015, Christian Brabandt wrote:
> >
> > > On Mi, 04 Mär 2015, Gary Johnson wrote:
> > >
> > > > On 2015-02-25, Christian Brabandt wrote:
> > > > > Hi,
> > > > >
> > > > > I made a new plugin to make Vim understand unified diffs.
> > > > >
> > > > > This allows to generate diffs using the patience algorithm which might
> > > > > provide better readable diffs. This really depends on the changes and
> > > > > will not always provide better results but at least this allows to
> > > > > easily switch between different diff algorithms.
> > > >
> > > > Hi Christian,
> > > >
> > > > Thanks so much for doing this. I often deal with messy merges, so I
> > > > am looking forward seeing the improved diff results. Of course I
> > > > haven't had to do any messy ones since I installed your plugin.
> > > >
> > > > I think I've found a bug. When I start vimdiff from the command
> > > > line with the option
> > > >
> > > > --cmd 'set diffopt+=iwhite'
> > > >
> > > > then execute
> > > >
> > > > :PatienceDiff
> > > > :diffu
> > > >
> > > > I get the error message
> > > >
> > > > EnhancedDiff: git diff not found in path, aborting!
> > > >
> > > > That message is not accurate. The real reason that the call to
> > > > s:DiffInit() fails (at line 109 of autoload/EnhancedDiff.vim) is
> > > > this:
> > > >
> > > > Vim(call):E121: Undefined variable: g:diffargs
> > > >
> > > > There is only one occurrence of g:diffargs in your plugin, and
> > > > that's at line 40 of autoload/EnhancedDiff.vim. I think that
> > > > variable is supposed to be s:diffargs. Renaming it fixes the
> > > > problem.
> > > >
> > > > I'm using EnhancedDiff.vim version 0.2 and Vim 7.4.640.
> > >
> > > Thanks! I am fixing it now and will upload a new version.
> >
> > BTW: If anybody has an example of some messy diff, where you'd like to
> > manually align the diffs, I would appreciate a copy. I am thinking of
> > adding the possibility to let the user manually align the diffs, so that
> > the resulting diff would look nicer.
> >
>
> I tried working on a plugin to do that once, and found Vim didn't support it using the method I was thinking of.
>
> I was trying to do it by splitting the files into multiple parts where the user marked alignment points, diffing the parts, and concatenating the diff of each part together.
>
> But Vim doesn't parse well when it finds two diff hunks adjacent to each other; it makes the assumption that adjacent differences are always combined in a single hunk.
>
> Eventually I was planning to look into what it would take to patch that, and write a plugin, but if you get to it first (or find another way to do it) I'd love to use it.

I remember that discussion and that was exactly the way I was trying to
do that. I was asking for examples, so that I could actually see, if
this will work. If not, we'll have to convince Bram to patch that part
out (I think this was just an off-by-one change).

BTW: If you want to contribute, I can give you access to the repository.

Best,
Christian
--
Frauen haben viele Fehler.
Männer haben nur zwei:
alles, was sie sagen
und alles, was sie tun

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment