DZone
Java Zone
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
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Eclipse Local History & Quick Diff

Eclipse Local History & Quick Diff

Erich Styger user avatar by
Erich Styger
·
Jul. 12, 12 · Java Zone · Interview
Like (0)
Save
Tweet
17.44K 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

  • Correlation Between Fast TTM and Containers
  • Common Types Of Network Security Vulnerabilities In 2022
  • What Developers Need to Know About Table Partition Pruning
  • Artificial Intelligence (AI) And Its Assistance in Medical Diagnosis

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • 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:

DZone.com is powered by 

AnswerHub logo