Eclipse and EGit: How to easily review changes to ALL modified files before committing to *local* repository - eclipse

I'm using Eclipse Indigo SR2 with the (built-in) EGit plugin v.1.3.0.201202151440-r and haven't been able to find any way to easily review all my changes before making a commit.
I used Eclipse with SVN for years, and this was always very easy to do. I would typically right-click on my project, select Team->Synchronize, double-click on the first changed file (in the Team Sync perspective), then hit Ctrl-. repeatedly to review all changes in one file, and then proceed to the next file, as I wrote a summary of my changes for the commit message.
But of course, git is very different from Subversion, and so my workflow must change. With EGit, "Team Sync" only appears to be useful for reviewing changes between my local files and the remote repository (i.e. before a push to the remote). I need a way to review changes since my last commit to my local repository. I generally don't even care to (re)review changes before a push to remote (and if I did, I'd prefer a simple equivalent of git log to see what commits I'm about to push).
If I right-click on my project and select Team->Commit, I am presented with a window that does almost everything I need to do (select files to stage, commit, write a commit message, amend a previous commit, etc.). What it doesn't allow me to do is quickly and easily review all my changes in a compare editor. I can't believe this capability doesn't exist! It seems I am required to double-click on each individual file, review the changes, close the compare editor, and double-click on the next file. That's ridiculous!
TL/DR - I am looking for a simple GUI equivalent (in Eclipse) to do what I am easily able to do from the command line using git vimdiff (where vimdiff is a git alias that uses vimdiff as the "difftool" to cycle through all modified files) followed by git commit (with perhaps a git add or two in between).
If no one has a good solution, I am curious about how others handle their commit workflow with EGit. I've been getting along fine committing from the command line (not that Eclipse is happy about that) but I can't believe that EGit is as near-useless as it seems to me. Perhaps my google-fu is not as strong as it once was?

Says here that you can see the diffs between the working tree and any given reference. Perhaps you should try out the latest version (Juno) of Eclipse/EGit and see if it's gotten any better?
Update: I've tried this out in the latest Eclipse, and as far as I can see it works fine. Here's how:
In the moment of writing this, Eclipse Juno 4.2 is the version you should go for. On the download page, you can pick between several packages according to your needs. The 'Eclipse IDE for Java Developers' comes bundled with EGit, but you can also install EGit into any distribution using the Eclipse Marketplace (under the Help menu).
Once you've imported your project into Eclipse, make sure the project is "shared":
Right-click project -> Team -> Share Project.. -> Git
Now do the following:
Switch to the Team Synchronizing Perspective.
Click the little synchronize button in the Synchronize View.
Choose Git
Pick a suitable branch to sync against, like refs/remotes/origin/master
Make sure to check the "Include local uncommitted changes in comparison" box
Click Finish
Now, change some files and watch them appear in the Synchronize View. Double-click the changed files to see the diff (like in the screenshot below).

Are you aware of the 'Git Staging' view. It keeps track of all the files that have changed and you can review the changes any time. (This can be a bit better than using the commit dialog)
An alternative is to commit all changes without reviewing, and then use the history view to compare two commits (Simply select the last top most commits, right click and select 'Compare with each other'). This way you do not have to keep double clicking individual files. If you need to change something you can always 'Amend' the last commit. (I usually follow this approach)

I am writing this as of Eclipse Oxygen, but it should apply to other versions as well.
Option 1 with team synchronizing view: right click the project > Compare with > Commit. You can choose your latest commit here, even if you haven't pushed it to repository.
Option 2 with diff view: If you want to see the "diff" version without committing, you can achieve this by right clicking your project > team > stashes > Stash Changes > check Include untracked files. This will save all of your changes to a stash. Then you will right click project > team > stashes > select stash you saved. You click the green arrow at the top right to re-apply all of your changes you stashed back to your code. In the same stash window, you will see a "Diff" tab at the bottom right. Clicking on the diff tab will show your changes in the red/green highlighted diff style. I wish there was a way to generate a diff view without stashing, but this is the only work-around I have found.

Related

How to find the SVN branch(s) or commits that resulted in the modification of certain parts of the code

Sometimes, I need to know when certain changes were committed to the SVN branch or trunk. For example, I see a code block and I want to find the approximate date when it was added, and what is the commit info used. Usually, the context of certain changes are described on the commit level, and the developer doesn't add comments to describe why it was added.
I am using Eclipse 2019-09 and SVN plugin.
Tarek
Display of Changes (Using Tortoise SVN and KDiff3)
To view the changes, follow the steps below:
Right click on Tortoise SVN icon and select "Show Monitor".
Screenshot 1: Display of Tortoise SVN Project Monitor
To connect to the remote repository, SlikSVN registration information is entered.
Screenshot 2: Connect to remote repository
Use the GUI for commit notifications, file history and more.
Screenshot 3: Display of changes
For example, to view the contents of the files in the sixth revision, double click on the file name and the KDiff3 windows opens.
Screenshots 4: By double clicking the file, the KDiff3 windows opens
Changes made using the KDiff3 windows are displayed at the file content level.
Screenshots 5: Display of file content level changes
In addition, differences between revisions (unformatted) and commit declarations can be viewed in history via the Eclipse IDE.
Screenshot 6: Viewing revisions via Eclipse IDE

How can I see where I am comitting to using team > commit on eclipse using svn / subversive

When I right click on a project and select commit it does not show the repository URL of where the commit is going in the commit window, which can be pain for developers. Is there a way to enable this?
Above the project I can see a path along the lines of https://repos.domain.com/repos, Trunk:trunk
Unfortunately this is not always accurate. For example when I am on a branch called MyBranchand select Team > Branch it makes the new branch within the MyBranch branch folder, instead of creating it within the branches folder. I've made this mistake a few times but by my project it will tell me:
https://repos.domain.com/repos, Branch:newBranch
when the path is https://repos.domain.com/repos/project/branches/MyBranch/NewBranch instead of https://repos.domain.com/repos/project/branches/NewBranch
Is there a way to improve on this level of accuracy?
Perhaps, Subclipse would be a better option.
Here's a screen shot of the Subclipse commit window on Eclipse 3.7. The Subversion directory is right at the top of the window.
Looks like Properties > SVN info. I didn't about this and was looking for something within the team menu. I'll leave the question open incase there is a way to view the full repository path next to the project.

Why is the merge tool disabled in Eclipse for a EGit-managed project?

As per the EGit User Guide, to use the merge tool, one should right-click on the resource with a merge conflict and then select Team > Merge Tool. However, when I do this, the Merge Tool option is greyed out. EGit is properly detecting the conflict and showing me both the icon and text label decorations for the file in conflict.
Any ideas?
It was disabled for me because I had some changes on my stash list.
$ git stash clear
fixed the problem for me.
It can depend on the version of EGit you are using, and on the operation that lead to the conflict.
See for instance bug 339092 which mention merge tool being not enabled in the case of a conflict after cherry-picking: only the just released EGit 0.12 would support that.
The only time (other than a bug) that the Merge Tool would be disabled is that when you are in any status other than the Conflicts one; i.e. you will only see that option enabled when the status is Conflicts. The status is shown next to the project name in most views, such as Project Explorer and Synchronize.
Make sure you have merged with desired branch, then if your merge results in conflicts, your project will enter Conflicts mode, and the Merge Tool will be enabled.
It seems to be a bug in EGit as VonC mentioned, but the fix is easy. I did it using reset branch option on the same menu that Cherry Pick option existed.
Note: git stash clear didn't help.
This happens if you tried to push changes to a remote and there were merges required from the remote. It fails with 'not FF' but also simultaneously detects the conflict. Don't ask me why it doesn't mark the whole project as conflicted at this point.
Open the Synchronize tab, right-click the project and select 'merge'. This immediately fails because of the conflicting file, and it switches on the conflict icon label for the project and enables the 'merge tool' option.
This is for EGit 4.0.3 in Eclipse Mars.
This also happens if you're in detached head state (in my case, I had checked out a remote branch and then forgotten).
Also, even after you've corrected the problem, you may have to select a different project and then reselect the one you actually want (just selecting in the package explorer view) in order for the menu to update.

Netbeans + Mercurial Graphical Diff

New to Netbeans (6.9.1) and Mercurial (1.7.5) (our company doesn't believe in open source software), I am specifically trying to get NetBeans' "Show History" command to work. Viewing this website, NetBeans <3 Mercurial, this looks like it should be simple. Make at least two commits, go to "Team -> [Mercurial ->] Show History" and you should see side-by-side changes. However, in both side-by-side screens within my NetBeans, all it says is .
On the other hand, if I use the command-line, typing "hg diff -r 3:4 file.htm", for instance, I get a valid diff. "hg diff --rev 4 file.htm" also gives a valid diff against the local, non-committed, changes.
Within NetBeans, "Local History" works quite well, but when I right-click, Mercurial -> Diff, the "Base" file on the left shows nothing - I'm assuming this is the latest committed file - while the local version on the right shows up.
My question: Is NetBeans set up correctly to work with Mercurial (it seems to be correct in all other cases), is Mercurial itself incorrectly set up (this seems like a hard thing to mess up), or is this a case of user-error?
I just started using NetBeans as well. One gotcha I noticed, when you do Mercurial operations, it only shows you results based on your selection in your project tree.
Try selecting the root "Source Files" in your project tree and then see if there is a difference when you run the command.

Eclipse Subversive plugin: Why can't I create this branch?

I recently switched from Subclipse to Subversive for SVN integration in Eclipse, and I'm having trouble creating a branch of my source code.
I've tried a few different variations of my method, but they all led me to the same roadblock. Basically, here's what I'm trying to do.
Navigator pane
Right-click on project folder (want to branch the whole thing)
Team > Branch
In the Location field, browse to select the /branches folder in my repository
Add the branch name to the path field, i.e. "/testbranch" (not pictured)
The dialog then looks like this, and I can't continue.
http://img820.imageshack.us/img820/1011/branchingfail.png
What am I doing wrong here? Why can't I create this branch? If nothing else, can it at least be confirmed that I'm following the right process, and it's something about my environment or configuration that's stopping the branch from being created?
I found that SVN is very particular with the SVN connectors. If you connected and downloaded SVN code with one connector and then switched to a different connector when you started using Subversive, you'll definitely have problems.
I've had unexplained Subversive problems in the past and they've almost always tracked back to different connector usage. The solution for me was to reset all of my local SVN code. I deleted everything local and rechecked out all of my code. Everything appeared to be fine after that.
I hope this helps.
I don't consider this a proper solution, but it's at least got me working again. Instead of running a branch operation, I created a new folder inside my branches folder, and then copied the contents of the trunk folder into it. I was then able to switch to my new "branch".
Make sure you do not have any uncommited changes, and then do a Team>cleanup. Also make sure you are branching from the trunk and that you do not have any mixed version. For example you can have a folder below the root be from another branch while the rest of the project is from trunk. This will cause the branch creation to fail. When having issues with branches from the navigator, try reverting the project (right click choose team>revert) several times. Then execute the cleanup several times.
Also you may consider creating the branch from the SVN Repositories view. From this view right click on the location you want to branch from (ie truck) and select New>branch from the context menu. One last step is from the navigator view you will need to swtich your project to the newly created brancn: right click on the project root and select Team>switch from the context menu