Branch to Branch Patching in Eclipse

The engineering department uses branching in our version control system to great effect. We follow a mainline branching model where major development occurs on the trunk and we create a branch for each major release prior to a release sprint. The branch is then used only for clearing up any issues that are found during the release sprint. Usually there aren’t very many bugs in the release branch, so the team spends most of their time developing on trunk.

In a recent release sprint, I was working on a complicated code-cleanup task on trunk at the end of the day we were supposed to branch. Rather than holding up branching and making things difficult for others working on the release, I told our build & release engineer that he could go ahead and split the release off of trunk. We had more important places to be that evening.

Major release branching

Major release branching

The next day, I finished up my task on my trunk checkout, leaving me ready to get my work checked into the branch. Doing so is a quite easy task if you utilize the patching functionality of Eclipse’s team integration, which is really just a good front-end for diff(1) and patch(1). After checking out the new branch, I just right clicked on the trunk checkout that held my modifications, selected Team > Create Patch..., choosing to put the result of the patch onto the clipboard. Then I right clicked on the freshly-checked out branch selected Team > Apply Patch... and applied the patch that I had just created.

That’s a long-winded lead up to a quite simple solution, but branching is an important part of good software development and the best way to utilize branching effectively is to understand how to use it easily.

  • Digg
  • StumbleUpon
  • Facebook
  • Twitter
  • Google Bookmarks
  • DZone
  • HackerNews
  • LinkedIn
  • Reddit