Discussion:
How to use meld with 'svn diff'
Frederik Uppesen
2008-04-14 21:22:14 UTC
Permalink
'svn diff' can be used to do a variety of comparisons across branches and revisions.

But asking svn to use 'meld' in its config file (by setting 'diff-cmd') results in a lot of complaints from 'meld'!

(I know that 'meld' is svn-aware --- that's useful for simple comparisons.)

What's the trick? I must be missing a helper script?

thanks

F
Vincent Legoll
2008-04-18 13:27:45 UTC
Permalink
Post by Frederik Uppesen
'svn diff' can be used to do a variety of comparisons across branches and revisions.
But asking svn to use 'meld' in its config file (by setting 'diff-cmd')
results in a lot of complaints from 'meld'!
Pure speculation, but diff-cmd is probably for setting the command to
get a diff file between 2 files or revisions.

For example you set diff-cmd to GNU diff.

What you want is another thing, you want to customize the app used to
*display* that diff.

The 2 things are different.
--
Vincent Legoll
Grant Edwards
2008-04-19 15:55:05 UTC
Permalink
Post by Vincent Legoll
Post by Frederik Uppesen
'svn diff' can be used to do a variety of comparisons across branches and revisions.
But asking svn to use 'meld' in its config file (by setting 'diff-cmd')
results in a lot of complaints from 'meld'!
Pure speculation, but diff-cmd is probably for setting the
command to get a diff file between 2 files or revisions.
Right. And he wants to use meld to "diff" those two files.
Post by Vincent Legoll
For example you set diff-cmd to GNU diff.
Except he wants to set it to meld, not to gnu diff.
Post by Vincent Legoll
What you want is another thing, you want to customize the app
used to *display* that diff.
No, that's not what he wants. He wants to use meld as the app
that compares the two files. You can do it, you just need to
write wrapper script that grabs the two file names from the
command line args and calls meld.
Post by Vincent Legoll
The 2 things are different.
I'll agree that the two things you described are different.
--
Grant Edwards grante Yow! If I felt any more
at SOPHISTICATED I would DIE
visi.com of EMBARRASSMENT!
Stephen Kennedy
2008-04-27 21:20:56 UTC
Permalink
Post by Grant Edwards
No, that's not what he wants. He wants to use meld as the app
that compares the two files. You can do it, you just need to
write wrapper script that grabs the two file names from the
command line args and calls meld.
It would be nice if meld could accept the most common diff switches
(even if it just ignores them) so that you wouldn't need an external
script.

Does anybody have the list of switches handy? I didn't see them in the
quoted link.

Stephen.
Kevin Grover
2008-04-27 22:10:32 UTC
Permalink
Post by Stephen Kennedy
Post by Grant Edwards
No, that's not what he wants. He wants to use meld as the app
that compares the two files. You can do it, you just need to
write wrapper script that grabs the two file names from the
command line args and calls meld.
It would be nice if meld could accept the most common diff switches
(even if it just ignores them) so that you wouldn't need an external
script.
Does anybody have the list of switches handy? I didn't see them in the
quoted link.
The details are listed in the SVN Book. I used them to write this script
which I've been using for a while:

------------------------ Start: svn-diff-meld
#!/bin/sh
# SVN Diff Wrapper for Meld
# KOG 2008-02

left="$6"
right="$7"

meld "$left" "$right"
------------------------ End: svn-diff-meld
Kevin Grover
2008-04-27 22:15:33 UTC
Permalink
Post by Kevin Grover
Post by Stephen Kennedy
Post by Grant Edwards
No, that's not what he wants. He wants to use meld as the app
that compares the two files. You can do it, you just need to
write wrapper script that grabs the two file names from the
command line args and calls meld.
It would be nice if meld could accept the most common diff switches
(even if it just ignores them) so that you wouldn't need an external
script.
Does anybody have the list of switches handy? I didn't see them in the
quoted link.
The details are listed in the SVN Book. I used them to write this script
------------------------ Start: svn-diff-meld
#!/bin/sh
# SVN Diff Wrapper for Meld
# KOG 2008-02
left="$6"
right="$7"
meld "$left" "$right"
------------------------ End: svn-diff-meld
I forgot to mention, I use this alias to invoke it (in bash):

alias sd='svn diff --diff-cmd=~/bin/svn-diff-meld'

I originally had it setup to run automatically, but that broke making patch
files, so I set up the alias for the graphic diff.

- Kevin

Grant Edwards
2008-04-19 15:51:46 UTC
Permalink
Post by Frederik Uppesen
'svn diff' can be used to do a variety of comparisons across
branches and revisions.
But asking svn to use 'meld' in its config file (by setting
'diff-cmd') results in a lot of complaints from 'meld'!
The "diff-cmd" that is called by svn needs to accept a bunch of
command line options/arguements. IIRC the two file names to
compare are args 5 and 6. The rest of the command line is a
bunch of options that once-upon-a-time were required to get the
gnu diff utility to do what SVN wanted it to do.

Hard-wiring the external diff command interface to be that of
an old version of gnu diff seems like a big mistake to me, but
at least the interface is documented.
Post by Frederik Uppesen
What's the trick? I must be missing a helper script?
Yes. The details are in the fine manual:

http://svnbook.red-bean.com/en/1.4/svn.advanced.externaldifftools.html
--
Grant Edwards grante Yow! Is this where people
at are HOT and NICE and they
visi.com give you TOAST for FREE??
Loading...