Feature Request: Enhanced diff tool

I would like to see the following features added to the diff tool.

1. Incorporate something like the DiffFilePlugin:
http://www.intellij.org/twiki/bin/view/Main/DiffFilePlugin

To allow two files in the project to be 'diff'ed, or using the commander
(!).

2. Extend the existing diff viewer to support easier merging of diffs.

I love the existing diff viewer, it would be great if it supported easy
merging of diffs. How this might work would be that you could click on a
particular diff line or section, and be given the ability to move it
over into the other file. This would be immensely useful.

Anyway, just my 2c, I will file a tracker request, but thought I'd bring
it out to the list for any additional feedback.

Thanks
Peter

17 comments

Or better yet allow for us to change the diff tool, for example to beyond compare if we have it

0

Ditto, Beyond Compare rocks for its capabilities to drill down the directory
and archive structure, merge directories and files
(http://213.190.42.244/whisper/space/2003-03-17#Beyond_Compare)

--
Edmundas
Whispering at http://213.190.42.244/whisper/space/start

"charles decroes" <spam@decroes.com> wrote in message
news:19168210.1049910944381.JavaMail.jrun@is.intellij.net...

Or better yet allow for us to change the diff tool, for example to beyond

compare if we have it


0

Considering what IDEA can do already, I would wish to have a more java
centric diff tool. A tool which can tell me that a new statement was added,
a new method was added rather than few lines of code being changed. that
will make visualizing code changes very simple.

-Dash.

"Edmundas Miseikis" <em@taide.lt> wrote in message
news:b71nk9$121$1@is.intellij.net...

Ditto, Beyond Compare rocks for its capabilities to drill down the

directory

and archive structure, merge directories and files
(http://213.190.42.244/whisper/space/2003-03-17#Beyond_Compare)

>

--
Edmundas
Whispering at http://213.190.42.244/whisper/space/start

>

"charles decroes" <spam@decroes.com> wrote in message
news:19168210.1049910944381.JavaMail.jrun@is.intellij.net...

Or better yet allow for us to change the diff tool, for example to

beyond

compare if we have it

>
>


0

On Wed, 09 Apr 2003 17:55:44 +0000, charles decroes wrote:

Or better yet allow for us to change the diff tool, for example to beyond
compare if we have it


Or Guify - darn fine Java based gui diff.

0

Interesting thought. If the built-in diff tool source were made public one
could extend it to do that... ;)

"Debabrata Dash" <dash@arcsight.com> wrote in message
news:b71r94$68i$1@is.intellij.net...

Considering what IDEA can do already, I would wish to have a more java
centric diff tool. A tool which can tell me that a new statement was

added,

a new method was added rather than few lines of code being changed. that
will make visualizing code changes very simple.



0

I totally agree with this. I'd love to know the difference between adding a
parameter, and just changing a parameter name. Or how many different things
changed within the same line (was it just a single character or a bunch?).

"Debabrata Dash" <dash@arcsight.com> wrote in message
news:b71r94$68i$1@is.intellij.net...

Considering what IDEA can do already, I would wish to have a more java
centric diff tool. A tool which can tell me that a new statement was

added,

a new method was added rather than few lines of code being changed. that
will make visualizing code changes very simple.

>

-Dash.

>

"Edmundas Miseikis" <em@taide.lt> wrote in message
news:b71nk9$121$1@is.intellij.net...

Ditto, Beyond Compare rocks for its capabilities to drill down the

directory

and archive structure, merge directories and files
(http://213.190.42.244/whisper/space/2003-03-17#Beyond_Compare)

>

--
Edmundas
Whispering at http://213.190.42.244/whisper/space/start

>

"charles decroes" <spam@decroes.com> wrote in message
news:19168210.1049910944381.JavaMail.jrun@is.intellij.net...

Or better yet allow for us to change the diff tool, for example to

beyond

compare if we have it

>
>

>
>


0

>a new method was added rather than few lines of code being changed. that

... or a method was just moved around in the class.

Tom

0

I never even thought of that. How cool would that be. Currently I have to check out code, reformat it, check it back in with no changes, then check it out again to make my changes. I have to do this because otherwise other people get upset that they can't tell what changed becausse I have remormatted the code. It would be awsome if a diff coll could tell me what really changed, like this method was pushed up, or certain variables were moved into an interface, It would be great if idea could do this, in the mean time does anyone know of a tool that does this?

0

I was too excited about this to wait for futher discussion. I have opened a feature request so go VOTE!!!!

http://www.intellij.net/tracker/idea/viewSCR?publicId=11430

I don't think I have been this sold on an idea in a long time. DASH your a genius :)

0

method level diff'ing is a great idea. In fact as I think about it it seems that this kind of diff'ing would be great at all scales.

At the macro level, when doing big refactoring jobs, it would nice to see the before and after tree structure to make sure that all required changes have been made. The key here is that all the chnages would be transposed on one tree structure. This really important when refactoring a library that affects a hal-dozen projects which have all been pulledinto one project for refactoring.

At a micro-level, I could imagine that seeing structural difference at an even smaller scale than methods could be nice: for-loops; while-loops; if-elses; etc. This would allow one to quickly detect when major algorithm blocks have been changed.

Is this to much....or overkill? Maybe.... I'm just brainstorming!

Floiran

0

I don't think it's overkill. One of the great things about idea is it lets you do refactorings at a higher level so you can think more about the big picture and not the details. I think we need a tool that shows differences at that same high level but will allow us to drill down to the micro level.

The biggest problems with diff tools IMHO is they work on the byte level. Do I really care that the indentation changed my source. In java and C I sure don't! What I do care about is that someone maybe added a new Object() inside of some loop that could run thousands of times. If I have to look at the byte level and they did a lot of reformatting I might miss that. OO code can be very subtle, missing one method call can kill you. Tracking actual code changes at the byte level is difficult at best.

0

The biggest problems with diff tools IMHO is they work on the byte level.


Anyway, such an enhanced Diff tool would be a totally different tool
compared with the usual dumb byte-level diff tool.
At the very least, using the PSI classes (the jetbrains' internal tree
representation of Java files), it should not be too complicated to compare
files with this "enhanced" approach.
It could be easy to parse two versions of a same file, and be able to say :
- there's a new method,
- this method has changed,
- there's a new parameter to this other method.
It would be a static analysys, without having to record all the user has
input in his favourite IDE.
I would even say that a plugin might be able to diff two version of a same
file with this kind of reporting you would like.

Well, a final word : a big + 1 !
It'd be a nice and innovative feature

Guillaume Laforge


0

Debabrata Dash wrote:

Considering what IDEA can do already, I would wish to have a more java
centric diff tool. A tool which can tell me that a new statement was added,
a new method was added rather than few lines of code being changed. that
will make visualizing code changes very simple.


An example of where this would be useful is when a university wants to
inspect computer science projects written in Java for sameness. Here in
Atlanta, Georgia, USA, Georgia Tech has had serious problems with
cheating in their large computer science courses on projects that must
be done non-collaboratively. Some of the projects are allowed and
encouraged to be done collaboratively, but others must not be. With this
tool, various surface level changes would not fool such a diff-er.

Jon

0

+10 ! Great ideas

However it sounds like it would have the potential to be fairly slow.
The problem is that adds and deletes are easy, detecting
movement or change within the file would be rather hard, and may run the
risk of detecting false positives.

But I'm sure Jetbrains guys will get it right. (:

Peter

Guillaume Laforge wrote:
>>The biggest problems with diff tools IMHO is they work on the byte level.


Anyway, such an enhanced Diff tool would be a totally different tool
compared with the usual dumb byte-level diff tool.
At the very least, using the PSI classes (the jetbrains' internal tree
representation of Java files), it should not be too complicated to compare
files with this "enhanced" approach.
It could be easy to parse two versions of a same file, and be able to say :
- there's a new method,
- this method has changed,
- there's a new parameter to this other method.
It would be a static analysys, without having to record all the user has
input in his favourite IDE.
I would even say that a plugin might be able to diff two version of a same
file with this kind of reporting you would like.

Well, a final word : a big + 1 !
It'd be a nice and innovative feature

Guillaume Laforge


0

Any chance we can get some feedback from the jetbrain people on this? It seems to be pretty popular based on how fast it was voted for. I'm kind of curious if you (jetbrains) think this is too unrelated to the actual ide to spend the amount of time it would require.

0

I hope that they can do it better than JBuilder and Eclipse.
JBuilder shows completely bogus diffs in some situation while Eclipse implementation uses too much memory and cannot handle big files

0

I like IntelliJ diff and merge.

What I think would make it 10 times more powerful is if the diff and merge
tools were Java aware, so that they could highlight, for example, a method
that changed instead of some rows.

Amnon

"John Smith" <jiveadmin@jetbrains.com> wrote in message
news:12164684.1054327541938.JavaMail.jrun@is.intellij.net...

I hope that they can do it better than JBuilder and Eclipse.
JBuilder shows completely bogus diffs in some situation while Eclipse

implementation uses too much memory and cannot handle big files


0

Please sign in to leave a comment.