Standalone gnu-diff like tool in Java

D

Dacong Yan

Hi,

Is there any gnu-diff like tools implemented in Java? The results I
got from Google is Eclipse Compare Framework & EMF Compare, both of
which are overkill for my needs, and Eclipse Compare Framework is not
standalone. Any clue provided would be appreciated. Thanks!

Dacong Yan
 
J

John B. Matthews

Dacong Yan said:
Is there any gnu-diff like tools implemented in Java? The results I
got from Google is Eclipse Compare Framework & EMF Compare, both of
which are overkill for my needs, and Eclipse Compare Framework is not
standalone. Any clue provided would be appreciated. Thanks!

I like subversion's 'svn diff', which works with repository URLs as well
as local revisions. I use it in conjunction with trac to manage change
sets. I occasionally use 'diff -r' after an 'svn copy' or 'svn merge'
for reference.

<http://subversion.tigris.org/>
<http://trac.edgewall.org/>
 
J

John B. Matthews

Dacong Yan said:
good idea! maybe I can dig inside svn to find its diff packages or
classes.

Conversely, if you find something preferable, svn diff includes a
--diff-cmd option, which bypasses the internal diff.
 
L

Lew

John B. Matthews said:
Conversely, if you find something preferable, svn diff includes a
--diff-cmd option, which bypasses the internal diff.

Why does it have to be in Java, particularly? Why not use 'diff', the
most 'diff'-like tool available?
 
L

Lars Enderin

Lew said:
Why does it have to be in Java, particularly? Why not use 'diff', the
most 'diff'-like tool available?

Emacs (M-x ediff) is the best diff I've found.
 
A

Arne Vajhøj

Lew said:
Why does it have to be in Java, particularly? Why not use 'diff', the
most 'diff'-like tool available?

The only reason to require Java I can see is if it is not a tool
but a library that is wanted.

Arne
 
L

Lew

The only reason to require Java I can see is if it is not a tool
but a library that is wanted.

Yes, but the topic here is a "standalone gnu-diff like tool in Java".
 
J

John B. Matthews

Lew said:
Why does it have to be in Java, particularly? Why not use 'diff', the
most 'diff'-like tool available?

Reading more diligently, I see I missed the "in Java" part. I may have
clouded the issue, as neither of my suggestions are Java. I can see Java
for maintainability, but I'd advocate (svn) diff for compatibility.
Subversion builds easily from source, which optionally includes
dependencies as a convenience.
 
L

Lew

John B. Matthews said:
Reading more diligently, I see I missed the "in Java" part. I may have
clouded the issue, as neither of my suggestions are Java. I can see Java
for maintainability, but I'd advocate (svn) diff for compatibility.

Compatibility with what?
Subversion builds easily from source, which optionally includes
dependencies as a convenience.

Or you can skip building svn altogether and just use 'diff', already
built and ready to go.

(Windows-based developers should install cygwin anyway.)

Of course, there's a good chance that as a developer one wants
Subversion for lots of other reasons, so it's no extra pain to use
'svn diff'. Still, I don't understand why the OP didn't just use
'diff' in the first place. They have not answered my question as to
why they want anything else, let alone in Java particularly.
 
J

John B. Matthews

Lew said:
Compatibility with what?

Patch. It's a little old-fashioned, but still a useful common-
denominator way to move changes between different development
environments. Of course, mature, open, cross-platform IDEs and version
control systems hide the gory details.
Or you can skip building svn altogether and just use 'diff', already
built and ready to go.

Or the diff feature in your favorite editor. NetBeans and Eclipse have
both improved considerably in this area.
(Windows-based developers should install cygwin anyway.)

Agreed.
Of course, there's a good chance that as a developer one wants
Subversion for lots of other reasons, so it's no extra pain to use
'svn diff'. Still, I don't understand why the OP didn't just use
'diff' in the first place. They have not answered my question as to
why they want anything else, let alone in Java particularly.

I'll second that.
 
A

Arne Vajhøj

John said:

I don't agree.

Except for very short term usage.

When developing on platform X the developer should
learn to use platform X not rely on tools that emulate
platform Y.

Arne
 
L

Lew

I don't agree.

Except for very short term usage.

When developing on platform X the developer should
learn to use platform X not rely on tools that emulate
platform Y.

I've been using Cygwin on every Windows box I've used since 2000. Its
tools are too powerful to give up. I have yet to detect a downside to
this practice.

I don't regard cygwin as "emulating platform Y", but as another shell
and utility suite, much as in Linux one has a choice of, say, cshell
or bash. Furthermore, having a free and robust X Windows server for
Windows is invaluable for using a Windows box as a terminal to Linux,
Solaris or UNIX hosts. Most places I've worked have heterogeneous
environments and use things like Hummingbird for the same purposes.

As far as I'm concerned, a Windows environment is not complete without
an anti-virus program, Spybot Search&Destroy, and cygwin installed.
I'm not going to give up all that functionality over an emotional
prejudice about "emulating platform Y".

Once you get addicted to the 'find' utility you can't go back.
 
A

Arne Vajhøj

Lew said:
Yes, but the topic here is a "standalone gnu-diff like tool in Java".

True.

I guess we would need input from the original poster to
resolve the mystery then.

Arne
 
A

Arne Vajhøj

Lew said:
I've been using Cygwin on every Windows box I've used since 2000. Its
tools are too powerful to give up. I have yet to detect a downside to
this practice.

I don't regard cygwin as "emulating platform Y", but as another shell
and utility suite, much as in Linux one has a choice of, say, cshell
or bash. Furthermore, having a free and robust X Windows server for
Windows is invaluable for using a Windows box as a terminal to Linux,
Solaris or UNIX hosts. Most places I've worked have heterogeneous
environments and use things like Hummingbird for the same purposes.

As far as I'm concerned, a Windows environment is not complete without
an anti-virus program, Spybot Search&Destroy, and cygwin installed.
I'm not going to give up all that functionality over an emotional
prejudice about "emulating platform Y".

Once you get addicted to the 'find' utility you can't go back.

I have been using it occasionally since 1997 (when it was
called Cygnus).

The problems are not purely prejudice:
* by not learning the native way of doing things one will be
somewhat lost on a box without all ones favorite tools - this
includes productions system where installing the stuff is not
an option
* it can create a communication barrier with the the other
team members that use the native tool set
* in some cases it can create incompatibilities - a C program
build under cygwin does not necessarily behave like the
same C program build with GCC mingw or MS compiler

Which is why I prefer to use GUI, cmd or VBS or Windows (I have
installed but not learned PowerShell yet) with a few cygwin
utilities in PATH and only goto bash when I have a *nix
shell script I need to run.

Arne
 
L

Lew

Arne said:
* in some cases it can create incompatibilities - a C program
build under cygwin does not necessarily behave like the
same C program build with GCC mingw or MS compiler

I completely agree with this point. I do not favor cygwin as a target
environment for development, but as a user-level tool suite.
Which is why I prefer to use GUI, cmd or VBS or Windows (I have
installed but not learned PowerShell yet) with a few cygwin
utilities in PATH and only goto bash when I have a *nix
shell script I need to run.

I also like to put cygwin's utilities in the win PATH, but its shell is just
so darn comfortable to use, I cannot resist it.
 
A

Arne Vajhøj

Lew said:
I also like to put cygwin's utilities in the win PATH, but its shell is
just so darn comfortable to use, I cannot resist it.

Like good chocolate or good beer (depending on your
preferences) ...

:)

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,479
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top