Saturday, June 23, 2018

Editing git commit template

Find and Edit git Commit Template

Git allows to define your commit template. The template file name is defined in your git config file.
git config --list
The default value is as follows:
commit.template=/Users//.stCommitMsg
I find it convenient to have certain values already added to the file. For example I am adding the current sprint number as well as the issue number to the commit.

This means that I usually edit the file once every sprint or sometimes if I want to per-populate the current issue number even more often.

To open the git commit template with one line without knowing the exact file name I put the following one-liner in my ~/.bashrc file
alias git-edit-commit-template="vim $(git config --list | grep commit.template | cut -d= --output-delimiter=$' ' -f1- | cut -d' ' -f2)"
As it turns out, there is an easier way to extract the value with using a git build-in command:
git config commit.template


Saturday, February 13, 2010

Developer Windows Box Tools

I recently needed to create my development environment from scratch and here is my (probably incomplete) list of tools I tend to install for may daily work and on a Windows box.

  • PowerShell (if Windows XP) a Windows Shell done right
  • CygWin what ever is missing in PowerShell, here it is
  • IntelliJ since there is the community edition, there is no reason not to have it
  • Krento fast access to the most used apps
  • Launchy (if Windows XP)
  • ClipX for hitory and batch processing Copy and Paste
  • gVim sometimes if I need a second different text editor
  • Notepad++ my preferred Text Editor
  • Google Chrome (Beta) with Extensions
  • FireFox with FireBug and other plugins
  • Sysinternals Suite by Mark Russinovich
  • Groovy mostly for writing unit tests
  • Ruby just in case
  • Scala
  • WampServer makes it so easy to install Apache, mySQL, php
  • Skype - sometimes I need it
  • DropBox to easily share files between distributed computers
  • Password Safe - how do you manage your passwords
  • Java in different versions from 1.5 to 1.6
  • Tomcat in different versions
  • Maven
  • Ant just in case there is a project that does not use Maven
  • ThinkingRock for GTD
I know there is more. In follow up posts I will start to list plug-ins for different apps like Google Chrome, Firefox, IntelliJ, etc.

Wednesday, February 03, 2010

SVN Frontend and Monitor

I recently installed SVN-Monitor which is a front end to SVN which runs on top of TortoiseSVN. What I like about SVN-Monitor besides its user interface is the ability to manage and monitor SVN working copies spread over different folders in one single location and if needed to update them all with one single click.

SVN-Monitor lets you set up SVN event alerts which when fired can trigger different kind of actions like for example showing a bubble on your task bar with corresponding information to the event.


Saturday, January 16, 2010

Programming in Scala

I am currently looking into the programming language Scala which compiles to Java byte code and can be run everywhere a Java JRE is installed. This alone makes it an interesting language.

For my studies I bought Programming in Scala, a book by the creator of Scala, Martin Odersky, and by Lex Spoon and Bill Venners publisched by Artima. Information on the book at the Programming in Scala can be found at the Artima book site.

IntelliJ Scala Plugin Compile Errors

Are you trying your first steps with Scala like I do, using IntelliJ with its Scala plug-in?
Do you see something like the following while trying to compile you Scala source code?

Information:Compilation completed with 3 errors and 0 warnings
Information:3 errors
Information:0 warnings
Error: error while loading Predef, Scala signature Predef has wrong version
Error:expected: 5.0
Error:found: 4.1 in C:\Users\\.m2\repository\org\scala-lang\scala-library\2.7.7\scala-library-2.7.7.jar(scala/Predef.class)

Well, if you are clueless like I was it might interest you that this problem is most likely coming from a lack of backwards compatibility in compiler version and that the IntelliJ plug-in for Scala that I use seems to use a newer compiler (Scala 2.8 -> internal 5.0) than what most libraries like for example scalatest 1.0 are compiled against (2.7.7 -> internal 4.1).

The remedy is to point your IntelliJ plug-in to the libraries downloaded with the Scala 2.7.7 final installation. As far as I know as of now you have to do this under Project Structure by either clicking on the Project Structure icon or by using Ctrl+Alt+Shift+S and then under Project Settings you select Facets. This should give you a dialog window where you can set the Scala compiler library and the Scala SDK library.

Make sure you did not install on a path with spaces because that would be interpreted as separate paths constructs.

Sunday, January 10, 2010

Scala for Notepad++

The Scala distribution comes with a Notepad++ syntax highlight configuration file. You will find the file under SCALA_HOME/misc/scala-tool-support/notepad-plus. As stated in the README file copy the xml file to %APPDATA%\Notepad++. There is a typo in the installation file and it says Nodepad instead of Notepad.

However, do not copy it in your Notepad++ installation folder as I first did not reading carefully enough the installation description.

Saturday, January 09, 2010

Clipboard Tool of my Choice

I recently installed a Clipboard history manager which I think is a very nice enhancement for a developer environment in particular and everyone else's in general who uses Ctrl-C and Ctrl-V a lot.

The tool of my choice is ClipX.

Coming Back To Eclipse: JVM Exit Code -1

Are you looking for a solution for failing Eclipse starts and instead of getting the IDE to run, you see a dialog with the following message (and more): JVM Terminated. Exit Code=-1?

I found the solution for my system: I was trying to run a 32bit Eclipse version on a 64bit JVM.

If you need more details, read on.

I haven't used Eclipse for about two years now after switching to IntelliJ when everyone in my company was using IntelliJ and it simply made more sense to use the same IDE.

Recently I wanted to do some programming on my private Laptop and installed Eclipse 3.5.1. Everything went fine, I uploaded more plug-ins and then had to pause for two weeks concentrating on higher priority tasks. Today I came back to my Laptop and when I tried to start Eclipse it did not start and instead gave me the nasty JVM exit code -1 error message. I could not figure out what had changed in the time between the last start and after 90 minutes of unsuccessful configuration changes and new install, JVM downloads and changes I got in a really bad mood.

I was almost about to give up when I stumbled over a posting by Phil Suh that finally opened my eyes and brought me back on the right track. Since my laptop is a 64 bit machine I had finally installed 64 bit JVMs and that was the change. I tried to run a 32 bit Eclipse on a 64 bit JVM. I should have known that.

As Phil points it out, Eclipse makes it kind of hard to find its Windows 64 Bit distributions. You need to go to the Eclipse Platform Download site and then download the Language specific plug-ins after you finished the platform install.

Tuesday, July 07, 2009

Quickr Flickr Greasemonkey Script from Dustin Diaz

I just installed Dustin Diaz' Quickr Flickr Greasemonkey script which allows you to post context aware replies to comments on your Flickr page.

From the script description
This allows you to do browse flickr with keyboard shortcuts. It 'sticks' the comment form, and allows the ability to 'reply' to specific comments