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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

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

From: Jeff King <hidden>
Date: 2016-06-15 22:45:25

On Sun, Sep 28, 2008 at 11:57:05AM +0200, Matthieu Moy wrote:
quoted
Neat. I started on something like this quite a while ago,
Did you publish/send it anywhere?
No, I was waiting to clean it up and test it a bit more.
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.
Yes, I would have made that argument. ;)
quoted
    [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.
Yes, I think currently most diff options supersede the decision about
whether or not it's binary (like textconv, in which you probably assume
the result is diff-able as text). xfuncname doesn't, but the example is
perhaps a bit contrived. So I do think of it as more of a way for future
expansion.

I seem to recall actually running into this as part of the textconv work
I was doing, but now I can't remember the exact details.  So that's not
that compelling an argumen.t :)

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