Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: Implementation of a "textconv" filter for easy custom diff.

From: Matthieu Moy <hidden>
Date: 2016-06-15 22:45:25

Jeff King [off-list ref] writes:
Neat. I started on something like this quite a while ago,
Did you publish/send it anywhere?
We have one major difference in our approaches. In yours, there is a
new "textconv" attribute that can be used. In mine, I subtly changed the
meaning of the "diff=foo" attribute to be "use the diff driver named by
diff.foo.*", and you would set diff.foo.textconv to your command. This
is a bit simpler to implement, and it provides a better path forward for
defining sets of diff tweaks.
Yes, that's an interesting approach too.

One point in favor of mine is that the "textconv" thing is no
necessarily limited to diff-ing. That would be really cool to have
"blame" use it too for example (with quite bad performance, but that
would be the first time I see a tool able to do this).

Well, OTOH, one could argue that "blame" is based on diff-ing, and
therefore it's natural to define a diff filter to tell how "blame"
should work.
For example, one of the limitations of the current syntax is that you
can't say "Choose automatically whether this is binary or text, but if
it is text, use this hunk header." But with my scheme it is easy to do:

  in attributes:
    file diff=foo

  in config:
    [diff "foo"]
    xfuncname = "some regex"
    binary = auto
No sure that would actually be useful in real life, but it doesn't
harm to have it. And the argument "better path forward for defining
sets of diff tweaks" is a good one IMO.

-- 
Matthieu
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help