Okay I just deleted a feature branch before merging it back into the development branch. What to do? Lucky I had already committed the changes to the feature branch which made recovery very simple. Continue reading
Author: nidkil
Yes you can: Diff with EGit in Eclipse!
In my previous post on how to quickly view all the changes between two branches in Git I ended with the statement “Is there away to do the same in Eclipse with EGit?“. I Googled around for the answer a bit, but with no success. By accident I just discovered how to compare the working version of a file to the commited version. Not entirely the same, but getting closer 🙂 For the purpose of being able to quickly check what changes I have made to write meaningful commit messages this is sufficient for me.
Anyway, these are the steps:
- Open Git Staging (Window > Show view > Git > Git Staging)
- Double click on a file in “Unstaged Changes” or “Staged Changes”
And voilà! There is a beautiful window with a side to side diff of the working version and commited version. Nice! I hope this is useful.
Wicked Shell is your friend: Using the shell from Eclipse
I am using the Git flow as my development model. It is very easy to understand and use. Keeps development nice, tidy and clear. See more information for links about Git flow.
When preparing a release the release or version number needs to be bumped (increased). This requires a shell script. I was switching to a command prompt to do this. Then I came across a nifty little plug-in for Eclipse, so I can execute the shell script from within Eclipse. It is called Wicked Shell. Continue reading
Easy way to quickly view all the changes between two branches in Git
I was commiting some changes in Git and needed to view all the changes between, so that I could write a meaningful commit message. I used the following command to view the changes in each changed file:
git difftool -v development
This command is viewing the active branch (checked out branch) with the development branch. It will open the changed files one by one.
Is there away to do the same in Eclipse with EGit?
Easy way of formatting strings in Scala
Scala offers two ways of formatting strings. This post describes both. Continue reading
Enabling task tags in Eclipse
In Eclipse you can add a comment using Task Tags like // TODO <task> or // FIXME. This should add that comment as a task to the Tasks. By default the Task Tags are disabled. Enable them as follows:
- Window > Preferences
- Type Task Tags
- Select that Task Tags under General > Editors > Structured Text Editors
- Check Enable searching for Task Tags
Awsome website to test jsoup
I am busy learning Scala. As an exercise I am rebuilding a web scraper that I previously developed in Java. I am using jsoup to handle the actual extracting of data. I came across an excellent website that you can use to test jsoup. Try jsoup is an interactive demo for jsoup that allows you to see how it parses HTML into a DOM and test CSS selector queries.
It even lets you load your own web page. Just hit the Fetch URL button, paste the URL you want to test and have fun testing your CSS selectors.
Give it a try!
Making a directory available to Eclipse
I was busy adding logging to a project today and added a logback.xml file to a resource directory under src/main. When running the application the logback.xml file was not being picked up. It turns out the resource directory must be added to the build path. A quick reminder how to do this:
- Right click on the project
- Select Build Path | Configure Build Path…
- Select the Source tab
- Click Add Folder…
- Check the check box of the folder to add
- Click OK
- Click OK
Everything should be working now.
Create multiple directories with a single command in Linux
Using the bash shell you can create multiple directories with a single command.
Examples
Relative to the current directory:
mkdir ./{project,target}
Relative to a path and create any parent directories that do not exist:
mkdir -p ~/git/myrepository/{project,target}
Increase the heap size of Eclipse
Just a reminder how to increase the heap size of Eclipse. This gives Eclipse a little more breathing space and speeds things up.
Steps
- Open the $ECLIPSE_HOME/eclipse.ini file in your favourite editor.
- Locate the line that starts with -Xmx and change it to -Xmx1024m.
- Save the file.
- Restart Eclipse.
You are ready to go.