You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Dickie <gr...@max-t.com> on 2002/11/12 15:05:45 UTC

graphical diffs


Hi,

  Is there an easy way to get a graphical diff from svn diff (eg: something 
like svn xdiff or a way to substitute which binary runs with diff)?

Thanks,
Greg

-- 
Greg Dickie
just a guy
Maximum Throughput
greg@max-t.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by kb...@gte.net.
Greg Dickie wrote:
> 
> Hi,
> 
>   Is there an easy way to get a graphical diff from svn diff (eg: something 
> like svn xdiff or a way to substitute which binary runs with diff)?

Not that I'm aware of, though maybe there is and someone will tell us.  OTOH, 
as soon as "svn cat" or "svn up -p" or whatever is available, then this will 
be easy; it only takes a very small shell script.  Though it might be more 
useful, but harder, to add an "--graphical" option to "svn diff". :-)

Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Dickie <gr...@max-t.com> writes:
> I think I can do #1 although I haven't looked in the source code at all....
> 
> thanks for the response,

Well, thank you for taking it on!  Just post here with any questions.

-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Greg Dickie <gr...@max-t.com>.
I think I can do #1 although I haven't looked in the source code at all....

thanks for the response,
Greg

On November 12, 2002 11:46 am, Karl Fogel wrote:
> Greg Dickie <gr...@max-t.com> writes:
> >   Is there an easy way to get a graphical diff from svn diff (eg:
> > something like svn xdiff or a way to substitute which binary runs with
> > diff)?
>
> Not yet, but it would be an easy patch to write, once we've decided on
> the interface.
>
>    Option #1 (simplest):
>       Add a `--diff-program' option to svn.  It specifies what program
>       to run for diff.  The program will always be passed two
>       arguments, and additional options can be passed to it via `-x'
>       as usual.
>
>    Option #2 (a little more complex):
>       First, implement option #1.  Then also add a run-time config
>       option that associates file regexps with diff commands.  The
>       default regexp is ".*", and it runs 'diff' of course.  See
>       http://subversion.tigris.org/issues/show_bug.cgi?id=668 for
>       a related issue.
>
>    Option #3 (maybe this is going too far):
>       First, implement option #2.  Then create a new property,
>       `svn:diff', whose value is a diff program to run and all the
>       options, for example "xdiff -b".  If the program can be found in
>       PATH, it is used for that file.  Otherwise, the default diff
>       program is used.
>
> This is just off the top of my head, though I'm fairly sure that
> option #1 at least is a good idea.  Would you have time to make a
> patch for that first?
>
> Thoughts, folks?,
> -K
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org

-- 
Greg Dickie
just a guy
Maximum Throughput
greg@max-t.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> I suppose we could wrap it ourselves, on the fly, using some sort of
> parsing system, something like
> 
>   svn diff --diff-file "wizzy-diff %1 %2 --first \"%3\" --second \"%4\""

Can we not call it "--diff-file"?  Although shorter, it may be
confusing to a lot of people, since the "diff file" often means the
file containing diff data, that is, input to the `patch' program.

Any of `--diff-cmd', `--diff-pgm', or `--diff-program' would avoid
this.

> Just avoiding the issue isn't going to work, seeing a cute, graphical
> diff between tmp.58928.00001 and tmp.53776.00001 is not going to
> satisfy the user.

Oh, don't worry, no one was proposing to ignore it (at least, that's
not what I meant).

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

> Philip Martin <ph...@codematters.co.uk> writes:
> > Make that four arguments: the two, possibly temporary, files and two
> > labels telling you what the files represent.
> 
> Ooooh.  This could get tricky, since for many programs, those labels
> will need to be passed as arguments to `--label' options (or
> whatever).  Not sure how we're going to work that out... One step at a
> time.

Easy, "svn diff --diff-file" simply passes the four arguments without
modification.  The program supplied by the user as the --diff-file
parameter converts the four arguments into the form understood by the
program the user really wants to run.  This wrapper program can also
convert the program's exit status into a return value that the
Subversion library understands, so that it can determine whether to
abort or continue.  We could even supply a set of "standard" wrappers
for common programs.

I suppose we could wrap it ourselves, on the fly, using some sort of
parsing system, something like

  svn diff --diff-file "wizzy-diff %1 %2 --first \"%3\" --second \"%4\""

(Why do some of the old $EDITOR threads come to mind?)

Just avoiding the issue isn't going to work, seeing a cute, graphical
diff between tmp.58928.00001 and tmp.53776.00001 is not going to
satisfy the user.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Philip Martin <ph...@codematters.co.uk> writes:
> Make that four arguments: the two, possibly temporary, files and two
> labels telling you what the files represent.

Ooooh.  This could get tricky, since for many programs, those labels
will need to be passed as arguments to `--label' options (or
whatever).  Not sure how we're going to work that out... One step at a
time.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Philip Martin <ph...@codematters.co.uk>.
Karl Fogel <kf...@newton.ch.collab.net> writes:

>    Option #1 (simplest):
>       Add a `--diff-program' option to svn.  It specifies what program
>       to run for diff.  The program will always be passed two
>       arguments

Make that four arguments: the two, possibly temporary, files and two
labels telling you what the files represent.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Blair Zajac <bl...@orcaware.com> writes:
> Option #4
>   In a configuration file, have a table where each row has a mime-type
>   and an associated diffing program.  Then when a diff is needed, svn
>   goes through the table with the file's svn:mime-type value.  This
>   removed the need to maintain a separate property, such as svn:diff.

Yes, and mime-type matching is better than file regexp matching, too.
Don't know why I didn't think of that! :-)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Tim Moloney <mo...@mrsl.com>.
Ben Gollmer wrote:

> Here's an easy way, I've been using it since I started with Subversion:
> 
> svn diff -r90:91 | kompare -
> 
> Or is everyone talking about binary files, and/or something more complex than 
> plain text diffs?
> 
> (For those not KDE-inclined, kompare is KDE's graphical diff tool. The - tells 
> it to read from stdin.)

I am one of those non-KDE-inclined people but this is just too cool.

I especially love the way it keeps the differences aligned as you
scroll.

-- 
Tim Moloney
ManTech Real-time Systems Laboratory
2015 Cattlemen Road                             \     /
Sarasota, FL  34232                     .________\(O)/________.
(941) 377-6775 x208                        '  '  O(.)O  '  '


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Scott Lamb <sl...@slamb.org>.
Ben Gollmer wrote:
> Here's an easy way, I've been using it since I started with Subversion:
> 
> svn diff -r90:91 | kompare -

That is nice. Though I had to do a "svn diff -x '-C reallybignumber'" 
for kompare's "Show entire file" option to do much.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Ben Gollmer <be...@jatosoft.com>.
On Tuesday 12 November 2002 12:43, Blair Zajac wrote:
> Karl Fogel wrote:
> > Greg Dickie <gr...@max-t.com> writes:
> > >   Is there an easy way to get a graphical diff from svn diff (eg:
> > > something like svn xdiff or a way to substitute which binary runs with
> > > diff)?
> >
> > Not yet, but it would be an easy patch to write, once we've decided on
> > the interface.

Here's an easy way, I've been using it since I started with Subversion:

svn diff -r90:91 | kompare -

Or is everyone talking about binary files, and/or something more complex than 
plain text diffs?

(For those not KDE-inclined, kompare is KDE's graphical diff tool. The - tells 
it to read from stdin.)

-- 
Ben

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Blair Zajac <bl...@orcaware.com>.
Karl Fogel wrote:
> 
> Greg Dickie <gr...@max-t.com> writes:
> >   Is there an easy way to get a graphical diff from svn diff (eg: something
> > like svn xdiff or a way to substitute which binary runs with diff)?
> 
> Not yet, but it would be an easy patch to write, once we've decided on
> the interface.
> 
>    Option #1 (simplest):
>       Add a `--diff-program' option to svn.  It specifies what program
>       to run for diff.  The program will always be passed two
>       arguments, and additional options can be passed to it via `-x'
>       as usual.
> 
>    Option #2 (a little more complex):
>       First, implement option #1.  Then also add a run-time config
>       option that associates file regexps with diff commands.  The
>       default regexp is ".*", and it runs 'diff' of course.  See
>       http://subversion.tigris.org/issues/show_bug.cgi?id=668 for
>       a related issue.
> 
>    Option #3 (maybe this is going too far):
>       First, implement option #2.  Then create a new property,
>       `svn:diff', whose value is a diff program to run and all the
>       options, for example "xdiff -b".  If the program can be found in
>       PATH, it is used for that file.  Otherwise, the default diff
>       program is used.

I was thinking along these lines.

Option #4
  In a configuration file, have a table where each row has a mime-type
  and an associated diffing program.  Then when a diff is needed, svn
  goes through the table with the file's svn:mime-type value.  This
  removed the need to maintain a separate property, such as svn:diff.

Blair

-- 
Blair Zajac <bl...@orcaware.com>
Web and OS performance plots - http://www.orcaware.com/orca/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: graphical diffs

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Dickie <gr...@max-t.com> writes:
>   Is there an easy way to get a graphical diff from svn diff (eg: something 
> like svn xdiff or a way to substitute which binary runs with diff)?

Not yet, but it would be an easy patch to write, once we've decided on
the interface.

   Option #1 (simplest):
      Add a `--diff-program' option to svn.  It specifies what program
      to run for diff.  The program will always be passed two
      arguments, and additional options can be passed to it via `-x'
      as usual.

   Option #2 (a little more complex):
      First, implement option #1.  Then also add a run-time config
      option that associates file regexps with diff commands.  The
      default regexp is ".*", and it runs 'diff' of course.  See
      http://subversion.tigris.org/issues/show_bug.cgi?id=668 for
      a related issue.

   Option #3 (maybe this is going too far):
      First, implement option #2.  Then create a new property,
      `svn:diff', whose value is a diff program to run and all the
      options, for example "xdiff -b".  If the program can be found in
      PATH, it is used for that file.  Otherwise, the default diff
      program is used.

This is just off the top of my head, though I'm fairly sure that
option #1 at least is a good idea.  Would you have time to make a
patch for that first?

Thoughts, folks?,
-K

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org