So as I am finishing up my work for my first week I am going to reflect on it here.
The week started with a pretty major annoyance. During the application process I was doing some commits to the Gitorious repo from a crunchbang machine, but I decided to setup a proper Debian install to work from this summer for the sake of consistency. When I tried cloning the repo Monday I realized I had to add my SSH key for my new install to gitorious, no biggie! Well apparently there was some kind of bug with Gitorious this week because after two hours of generating multiple keys and uploading them to Gitorious, it refused to add my key and mark it as ready so I could work with the repo. I ended up cloning the repo over https but it took until Thursday for me to be able to have my new key successfully add to Gitorious. Lesson learned, check your dev environments before you start working.
Once I decided to stop worrying about my SSH key for the time being I decided to begin working on implementing a Three-Way merge algorithm for Elektra KeySets in C++. While I am familiar with the basics of a three-way merge I decided to research some full featured implementations and see some robust versions of three-way merge. After familiarizing myself with some more robust algorithms I starting coding a header file and realized I didn’t know the best ways of working with Elektra Keys and KeySets. I turned to the Elektra documentation and read over the various functions for Keys and KeySets. I decided some technical details for my three-way merge which I wrote in a Learning file I added to my branch of the Elektra repo. As you can see, I am still trying to figure out the best way of working with Key Values in elektra. Here is a blurb from that file:
For my merge implementation I plan to iterate though KeySets using ksHead, ksTail, ksCurrent, and ksNext. I am writing two functions, one to determine if two keys are equal (from a merge standpoint) and a similar function for keysets. To compare the keys I was looking at using keyValue but I'm not sure if that is a better solution than keyGetString and keySetString. I have to look more into binary keys though to see how I can make kdbmerge compatible with all keysets.
Other than starting the three-way merge I greatly updated the man page for the kdb merge tool I will be writing later in the summer. The main reason for doing this was just to help visualize what the end product should look like so I can make sure my C++ implementation is written to support the necessary functions.
One of the more important things I have learned this week is how different the workflow is when working on production software as opposed to school projects. I have never worked on a piece of production software before. Generally I have done projects by myself or in small groups and we kind of just keep track of what’s going on. This is impossible with larger projects like Elektra. I am new to git, I just learned how to use it when applying for Google Summer of Code and I have to say it’s simply awesome. I have already been using it to version projects for school or personal projects, it’s just so easy and well organized. With that said, it has taken me a while to figure out what all of the files in the Elektra repo do. When beginning to write the merge code, I realized I had no idea how to include the header files I need because they weren’t in the same directory, I didn’t even really know they were. I wrote about that in my Learning file as well, luckily Markus pointed me in the right direction. Here is a little blurb from that file:
Additionally, I just figured out how to include kdb.h and support for keys in my merge. Somehow I guess I missed the src/tools/kdb folder. This is the first time I have worked on such a large project and its much more complicated to view such a large project from a top-level view then I am used to. I feel like I am starting to get a good understanding of elektra now and how all of the parts of elektra interact (especially kdb and the actual elektra library).
I will say that in a short week I have learned a great deal of what real work looks like in this field. As much as University is supposed to prepare us for our careers, a classroom is very different than a work environment. That realization has made me very glad to be a part of GSoC. I feel like this summer will prepare me for my career in a way that I can’t get in a classroom.
This week I planned to have a basic three-way merge completed. I am not quite there. However, I did update the kdb man document and learn a lot about the workings of Elektra so I think I will have a much easier time next week.
So for next week I want to have a basic, working three-way merge of Elektra KeySets that correctly handles all types of keys and compiles properly when building the elektra source. Additionally, I want to have a full plan written out for how I will be testing the C++ merge implementation as well as the kdb merge tool. Ideally I will have a few basic tests for the C++ merge tool.
Till next week (or if I have something interesting to share),