DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Eclipse Local History & Quick Diff

Eclipse Local History & Quick Diff

Erich Styger user avatar by
Erich Styger
·
Jul. 12, 12 · Interview
Like (0)
Save
Tweet
Share
17.85K Views

Join the DZone community and get the full member experience.

Join For Free

i worked long hours on my project, and it was working well. but after a series of edits, somehow the application was not working the way it should. what did i change to break my code? usually i smile, because i have things in a version control system. but: not this time (i should know better!). luckily there are some ways to find out what has been changed: with the local history and quick diff .

local history

even if not using a version control system, eclipse has a local history built-in. to compare and diff with the history, i use the menu

compare with local history

compare with local history

this opens the history view which offers compare and merge (see compare and merge in eclipse ):

history view

history view

the number of entries (and size) of the local history is configured in the following workspace setting (menu window > preferences > general > workspace > local history ):

local history preferences

local history preferences

note: keeping a long history might slow down eclipse, especially at workspace closure time (see codewarrior tool tip #3 ). so better not to keep too much of history.

quick diff

the local history is nice, but there is even a faster way: quick diff !

quick diff can be enabled (if not already done) in the workspace settings (menu window > preferences > general > editors > text editors > quick diff ):

quick diff preferences

quick diff preferences

in the settings i can change the colors, and as well what to use as reference ((version on disk, latest cvs version  or pristine svn copy).

note: there seems to be a problem (oversight?) in eclipse (at least 3.6) with using ‘version on disk’: with saving a file the quick diff markers are gone too :-( . but it works as expected with the svn settings. another good reason to use svn :-) .

there is a general option to enable quick diff, and i have enabled as well the ‘show differences in overview ruler’.

what it does: it shows the differences in the left editor area (where usually the line numbers are):

quick diff color marker

quick diff color marker

the colors are as configured in the quick diff preferences shown earlier.

if i move the mouse over the marker, a pop-up window shows up:

quick diff mouse over

quick diff mouse over

the first character in the pop up indicates what has changed:

  • >: changed line
  • +: inserted line
  • -: deleted line

note the ‘press ‘f2′ for focus’ : that way i copy and restore my earlier version. quick is simple and fast  and gives me an immediate access to the earlier version.

happy quick diffing :-)

History (command) Diff Eclipse

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 5 Common Firewall Misconfigurations and How to Address Them
  • Multi-Tenant Architecture for a SaaS Application on AWS
  • Test Execution Tutorial: A Comprehensive Guide With Examples and Best Practices
  • The Beauty of Java Optional and Either

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: