So once more, development on an internal project hit a stumbling block. The latest release of Dojo, 1.3.1, has some bug fixes I'd like to use, and in general I like to keep my main project working with the newest dojo releases. But 1.3.1 introduced a new security constraint that basically escaped all the html that I was showing in a grid control. Suddenly, instead of rich text, I get HTML markup!!!
The issue was raised a month ago, and a patch added to the Dojo trunk. But the 1.3.1 version was not patched, and the patch wasn't applied to the 1.3 branch, either. And the patch, adding a flag called "escapeHTMLInData" seems like a sensible approach, so I wanted to start coding for it. Except that the trunk of development, as the only place with the patch, had too many other changes implemented that I did not want to deal with just yet.
Git to the rescue. Git, if you don't know, is a popular source-code management tool we use at Freelock for managing all of our development, as well as keeping sites maintained.
Here's what I did to get the patch into my main codebase:
- git checkout -b gridEscapePatch svn/release-1.3.1 # Create a new branch called "gridEscapePatch" so I can still switch to other points without losing the patch
- gitk --all # pull up the entire history of Dojo, and in the search box, search for "EscapeHTML". This pulled up the commit containing the patch I wanted to apply.
- git cherry-pick 18f0dc99798 # Once I found the commit containing the patch, apply it to my current tree.
That's why I like using git.
I'll write a post on how we manage dojo in git as a submodule of our main projects soon, but for now if you want to clone our dojo git repository, use "git clone git://git.freelock.com/git/dojo.git" to get your own copy.