Development

A Good Case for Git Interactive Rebasing

One thing that drives me crazy is a messy git log full of unimportant commits. While I subscribe to the commit often philosophy during development, it does lead to commits which have no historical significance to upstream project branches. Who needs a git history full of commit messages like corrected spelling and fixed a php notice. These commits are helpful during active development, but they just clutter up git history if pushed to an upstream repository. It doesn't have to be this way!

Blog Category: 

Saving and Updating Nodes with the $node->language Property

Well, you can certainly learn something new about Drupal everyday. I spent a good bit of time trying to figure out why I couldn't perform a simple field value update to a few nodes in an application. So, node_save() was running without error, and nothing I attempted to update in the node object or related fields would save.

Blog Category: 

How to Export a Single File Form a Git Revision to the Local Working Copy

I needed to test an older version of a file in a web app, but didn't want to checkout the entire codebase. The method below allowed me to easily checkout an older version of the file using the commit hash that I knew had the correct file. Other git object references such as tags, branches, and commits from HEAD can be used instead of the commit hash (full or short SHA). See details here.

$ git show [commit-hash]:/path/to/file/file.txt > file.txt

Blog Category: 

Sublime Text 2 Find Function Definition Package

I have some friends who use Eclipse for development. While I see the draw to a full-fledged IDE, I do not enjoy the weight that is required. I prefer a non-Java (native Cocoa compiled) and lightweight text-editor on my Mac. While I really enjoy Sublime Text 2, I have been jealous of Eclipse’s “F3 Open Declaration” capability. Eclipse allows you to track a class, function, or variable to its initial declearation. I especially want to track functions decleration’s in my Drupal projects.

Blog Category: 

Pages