“git rebase -i” – finally

As you have already guessed from the title of this post that I am a beginner in git. So far I was making do with basic pull, diff, add, commit commands in git. But when my mentor reviewed some 10 patches that I sent him and shared his feedback, he suggested me to get familiar with the following three as they were to be my “new best friends” when I incorporate his reviews in my code.

git commit --amend
git add -p
git rebase -i

Barring “git add -p”, the other two will help you to rewrite your commit history. I needed to squash some of the commits, amend nearly all the commit messages and amend some of the commits themselves to make necessary changes in the code based on the feedback from my mentor. Initially, I was very apprehensive about the whole thing. But you can trust Rewriting History chapter of the Pro Git book and get started.

Advertisements

Gnome internship – my experience so far

I am 22 days old as a Gnome OPW intern and it has been a very nice experience so far. I was supposed to write at least one blog post in every two weeks. But, sometimes I get this writer’s block when words simply fail me. Besides,in the last few weeks, I really enjoyed writing code and I rarely wanted to write anything other than that! 🙂

So, what am I working on?
I am writing server and client libraries for GeoIP and WiFi geolocation service.

What have I done so far?
I have written the server side code. You can find it here
It looks up the GeoLiteCity database which provides free geolocation data for an IP address and returns the geolocation data in JSON format. So if you query with an IP eg. 44.66.55.66, you will get a JSON output like the following –

{"results":{"44.66.55.66":[{"location":{"latitude":32.807201385498047,"longitude":-117.16490173339844},"address":[{"name":"San Diego","type":"city"},{"name":"California","code":"CA","type":"region"},{"code":"92111","type":"postalcode"},{"name":"United States","code":"US","type":"country"}],"timezone":"America/Los_Angeles","accuracy":"city","attribution":"This product includes GeoLite data created by MaxMind, available from http://www.maxmind.com\n"}]}}

What new stuff did I learn?
Oh! A lot of things! Setting up the Apache web server, using Git and the Glib libraries were new to me. But What wasn’t new yet I had to relearn and give importance to was coding style. Initially I was not paying much attention to the existing conventions. I made my mistakes and shamefully I confess, more than once (which is REALLY very embarrassing!). But on the brighter side, now I have become more cautious about it.

What next?
I have started working on the client side. I have already written a synchronous function to fetch data from the server. But I need to make it an object. So at present I am trying to learn Gobject. I am planning to write the asynchronous version of the function in this week as well.

How to get started in FOSS

I’ve started contributing to FOSS projects since the last month and I’ve already found myself telling two newbies how to get started in FOSS. Although I love to give “gyans” and explain stuff to people, I thought here’s a good opportunity to write on this topic a post as comprehensive as my limited ability and knowledge allows me to.

Before anything, let me first tell you how I got started. I was just done with writing my mains for the UPSC Civil Services exam in October 2012 and I was thinking what to do next now that my 3 year long journey as an UPSC aspirant just got to an end. I decided to try out software again since that’s what I was doing before starting my preparation for UPSC.
Now I’ve been using Ubuntu at home since around 2007 and through out my 4 year long career I’ve worked on Linux environment. I’ve also seen and known a few open source enthusiasts and serious contributors. And husband being a little geeky-software-guy helped me to join the FOSS bandwagon easily. Quite fortuitously around that time, Gnome foundation was offering internships to women to promote women in computing and particularly FOSS. I got through. That’s enough about my history and let me now help you with what you’ve come to read at this post. How do you start contributing to the FOSS projects? Well, there are many ways –

First, get a open source OS at your home computer and get rid of that nasty little thing named after one of those things that you see in every home. Then join various Linux User Groups in your college, city or state. Many of them have IRC channels, join them as well. Lurk around in those channels. Many a times you get posts asking for volunteers.

I got to know about the following projects while applying to Gnome OPW
1. Gnome
2. Subversion
3. Wikimedia
4. Tor

There are others as well –
1. Mozilla
2. Openhatch

If you are a student you might consider Google Summer of Code

My list is not exhaustive and it can not be so because there are just so many open source projects which need contributors. I’ve shared the above list because that’s how I started. Along with the sites mentioned above, I also visited many other open source projects which I used or would have liked to use.

Therefore if you are waiting to get your hands wet in some good work or just feel that free and open source software is the right way to go to bring some equality in this otherwise unequal world, then do not wait for someone to give you work. Start browsing though FOSS projects, use them, find bugs in them and start fixing them.

And one last thing to say before I end my long post – “help will always be given at Hogwarts, for those who ask for it” – just replace Hogwarts with FOSS community. Be polite, ask around for help. Some of the folks are actually nice, you know, even though they hide behind geeky-unfathomable-nicks! 🙂

Learning Git

I’ve used CVS and SVN during the 4 years that I worked in the software industry. Moving from CVS to SVN was a good experience. Now that I’m working on GeoIP and Wifi Geolocation server and client libraries with Gnome, I ‘ve started using git. This is my beginner stage and am going to keep a list of websites helping me to learn git. So here goes the list –

1. try.github.com will give you a basic understanding of git.
2. http://gitready.com/
Once you complete try.github.com training, you’ll get the following links –
3. http://github.com/training/online
4. http://git-scm.com/book
5. http://gitimmersion.com/
6. http://rogerdudler.github.com/git-guide/
To know  about “git add -p” ( a very useful command )
7. http://johnkary.net/blog/git-add-p-the-most-powerful-git-feature-youre-not-using-yet/

If you by any chance bump into this page and find any good source for learning/mastering git, then please do share the URLs.