Quick git workflow for small teams

Uncategorized

Here is a simple and straightforward way of using git in small teams. I have tried different approaches and think this works well for teams up to a size of 5 people. Beyond that, you may incorporate some more sophistication in the workflow, but that can be in a different post.

For this post, assume that the team is set up with github as the remote from where everyone cloned. I won’t go into the details on how to clone from github and get setup with remotes etc. If you follow simple steps, this is a very standard configuration. However, if you do need help with this, try one of these useful books.

Master should never be broken

The master is the branch that is never broken. It is the branch that is deployed to the production site. You should always have full confidence that deploying the master doesn’t break anything.

git workflow small teams

The workflow

Before you start working on a feature do this:

git checkout -b my-awesome-feature

As you make your changes you can commit them

git commit -m "made an awesome change"

To back things up, also just push your branch up to your remote. The following command will automatically create a branch called “my-awesome-feature” on your remote and your commits will be available there cleanly in a separate branch

git push origin

To make sure the world hasn’t changed too much since you started working on this feature, you want to grab the latest from master and make sure your changes are still valid on top of it. If you rebase often, you will have less surprises when you merge.

git rebase master

Happy with what you have? create a pull request. Go to Github, find the repo, look for your branch and select “create pull request”. This way someone on your team can review your changes and give you a quick code review. When they are happy with your work, they can press the “single green button” to merge that into master.

Now, master has the latest code, so you can delete your branch safely.

git branch -d my-awesome-feature
git push origin --delete my-awesome-feature

Deploy the master to your production server using whatever deploy method you like. It could be heroku, or your own server with shell scripts, build or CI system or whatever floats your boat.

How to install PhantomJs on a CentOS server

Uncategorized

I was playing around with using a server to run end to end scenario testing using PhantomJs (new to it, check out some useful books here). I like that PhantomJs has minimal requirements. However, I did have to install a couple of libraries that I didn’t find clear documentation for. So to benefit anyone who might be trying to do this, here are my steps:

Download Phantom

[samh@do ~]$ curl -O https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-i686.tar.bz2
 % Total % Received % Xferd Average Speed Time Time Time Current
 Dload Upload Total Spent Left Speed
100 13.0M 100 13.0M 0 0 2908k 0 0:00:04 0:00:04 --:--:-- 3402k

Extract directory

[samh@do ~]$ tar xvf phantomjs-1.9.1-linux-i686.tar.bz2

Copy binary to bin folder (note you may need to use sudo if you are not logged in with root priveleges)

[samh@do ~]$ cp phantomjs-1.9.1-linux-i686/bin/phantomjs /usr/local/bin

You will notice that this is not enough to run Phantom and you will encounter this error:

[samh@do ~]$ phantomjs hello.js
phantomjs: error while loading shared libraries: libfreetype.so.6: cannot open shared object file: No such file or directory

Here is the step to eliminate it:

[samh@do ~]$ sudo yum install freetype

Then you will see another error:

[samh@do ~]$ phantomjs hello.js
phantomjs: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

And here’s how to eliminate it:

[samh@do ~]$ sudo yum install fontconfig

This is it. Everything should work now:

[samh@do ~]$ phantomjs hello.js
Hello, world!

… I love you … Please Repeat?

Uncategorized

Me: What time is it?
She: It’s 10:48 pm

Me: What day is it?
She: The date is Tuesday, December fifth two thousand and six.

Me: When is my next appointment?
She: Tomorrow at 4:30 pm in 2260 USB

Me: Play music
She: Do you want to listen by genre, album, artist or anything?
Me: Artist
She: Do you want to listen to U2, Phil Collins, Collective Soul, …
Me (interrupting): U2
She: Playing U2 … (Windows Media Player opens up and Zooropa starts)

Me: I think I am falling in love with you!
She: Please repeat!
Me: I said I think I am falling in love with you!
She: Please repeat!
End of converstation.

I had the above conversation with my phone after installing Microsoft Voice Command on it. It really is one of the most amazing voice command softwares I have seen. It’s a good example of the serious research microsoft has been doing in “speaker-independant voice recognition”. You do not need to train this software, just speak to it in natural english and it works fine (if she can understand my Indian accent, I think she is pretty good).

Oh yes, I call the software a “she”. I just can not bring myself to calling her an “it”. Examples of other things I can ask her to do:

“What is my schedule for today”, “Change profile to silent”, “Turn off all reminders”, “call john at work”, “start calculator” etc. She even reads out the contents of emails that I receive. This software is a good reminder of the fact that we really are getting somewhere with digital assistant technology. I would really recommend watching the demo video to get a sense of what it really feels like.

Closure

Uncategorized

So you quit your job in a good software company, move to a new country, start school again but it just doesn’t feel complete until you do that one thing: Format+Clean+Reinstall Windows on your laptop.
I finally got around to doing that yesterday and it’s only now that I feel like my “transition” is complete.
Microsoft Office 2007Interestingly, as a cheaper alternative to Microsoft Office 2003, I go ahead and install Microsoft Office 2007 Beta (which can be had for as low as $1.50 which gives you a valid license till Feb 2007). And I am quite impressed by it. Coupled with Microsoft OneNote 2007 Beta, I feel all set for school. Proudly using Microsoft Outlook 2007 Beta for all my structured and non-browser information needs I am happy that they have removed the Exchange Server bias and treat IMAP accounts with more respect. I also go ahead and install Internet Explorer 7 RC1 and I am surprised at myself for not using Firefox anymore. More interestingly, I also go ahead and Format+Clean+Reinstall the OS on my phone and I suddenly become aware of how stress-relieving this activity can be.
Six ZoneTick clocks in taskbar, auto-arranged in 2 columnsOfcourse, I do not feel complete until I have installed Zonetick which I so willingly bought as the best solution to the “what time is it there?” problem. Dictionary and Translation software by Babylon
Nor can I feel at ease until I install my good old Babylon – a tool which is surprisingly indispensible despite the fact that a browser can probably get you more information than it. Probably its only winning factor now is that it’s a more efficient and structured interface to the big-bloated-information-blob the Internet is.
With a light heart and a light mind I sleep at peace when I retire to bed.