So, because I'm such a geek, I'll post more about my Git experience.

  • Juggling multiple states. I've been handling several aspects of the project at my current assignment. Particularly, I'm more or less in charge of the Ant build files, a JMS consumer for asynchronous task execution, and various other code-fu. Recently, Butch put the task of writing and wiring code to inject domain objects with a crypto service class— an instance of which is only available in the HTTP session. Which means that, ordinarily, one couldn't do it via Spring: we're talking about domain objects (which aren't ordinarily managed by Spring) and session scope (which isn't available until the HttpSession is created).

    Enter Spring 2.0. We moved to Spring 2.0 recently, primarily for better JMS support. As a side-effect, we get shiny new stuff in the form of Spring 2.0's new bean scopes and better AOP support, which are godsends.

    So, I set up my Git working tree to handle experimental work (which won't hit the central SVN repo until I'm actually sure that I've gotten my tests to run green) by creating a branch for it. With the branch set up, I can switch between my main (master) branch, where I work with the stuff that should hit everyone, and more experimental tree-breaking stuff. Switching between the two is as simple as doing git checkout master and git checkout my-experimental-tree. And, I have a third tree where my tree-specific config changes are applied and versioned, where I actually run tests and build test WARs and what-not.

  • Maintaining tree config files for testing. The codebase for the project I'm working on uses several configuration files in the form of Java .properties files. To separate test configurations, I have separate trees. The advantage of this setup is I can use my work branches for real work, and switch over to the test configuration branches to test various configurations. Also, I keep debugging code in these branches— I usually write some tracing logic in the form of simple System.out.println statements, which I don't want to check in.

  • Experimenting safely, while offline. Since Git affords me offline commits, I can create a branch with git checkout -b experimental-codebase, experiment, and later on apply certain patches from that tree into my mainline branch with git cherry-pick <commit-id>. This preserves my commit log message, and applies the necessary patch. I haven't yet tried out patch managers (such as quilt), but I would be willing to bet that they'd be of much help

Previously: Is The Long Hiatus Over Yet?