tool to build SmartOS changelog

Ugly as sin, but it even works in a Mountain Gorilla checkout where origin is in the cache directory and don't have the other branches visible...
You have inconsistent indentation here and in the functions. Stick with what you've got above, eg. use tabs and then four space continuations.