supertonsky
supertonsky

Reputation: 2743

Given a specific revision, how do I compare or diff a file with my working copy or head revision?

I know in eGit there's compare to "commit.." option but that may not include the given revision I'm trying to compare with.

Say, in one specific build the revision is a3. The file was modified in revision a1, a2, a4.

a3 happened after a2.

The problem is that in the list of options in eGit's compare to "commit..." a3 revision isn't there because the file wasn't modified in that revision. I want to compare a file in my working copy or in the latest revision to whatever that file contains in revision a3.

I'm trying to avoid the tedious process of finding out what was the last revision that changed the file before the given revision.

Upvotes: 1

Views: 105

Answers (1)

robinst
robinst

Reputation: 31467

Yes, EGit filters the list of Compare With > Commit... to the commits that modified that file, otherwise the whole history would be shown there.

Do I understand you correctly that for your specific use case, you already have the commit hash of the revision to compare to in hand?

If so, it would be relatively simple enhancement if one could input an arbitrary commit ID in the Compare With > Commit... dialog. Could you please file an enhancement request here?

How to do it currently:

  1. In the file context menu, use Team > Show in History (or Show In > History)
  2. Disable filtering in the view by selecting the repository icon (Show all changes in repository containing the selected resource)
  3. Find the commit you want to compare against (using the find button or scrolling)
  4. Open the context menu of the commit and select Compare with Workspace

Upvotes: 1

Related Questions