Back On Track

Mahmoud Ahmed Khalil
2 min readJun 21, 2020

--

In this blog post, I would like to give an overview of what had been done in the last couple of weeks, and the plan for the next few weeks. You can see my Project on GSoC GNOME Projects Page (https://summerofcode.withgoogle.com/projects/#6096970302619648), also you can see the Project Issue on GitLab (https://gitlab.gnome.org/GNOME/gitg/-/issues/270).

During the Community Bonding Period, I met with Alberto(my mentor) on Hangouts. We got to know each other more, and he gave me a task so that I get more familiar with the libgit2 and it’s wrapper that we use in Vala and in gitg libgit2-glib. During the implementation of the task, I got more comfortable with the workflow of gtk development, and I read more about the Meson Build System and how to build Gtk Application with it.

The task was to create a tool to compare two commits with each other using libgit2-glib and show the result to the user in TextView Widget. The user would have to enter the SHAs of the two commits, then we would use those two SHAs to compute the difference between the two commits and show the result to the user. Here is the link for the project.

I had to read more about the libgit2 library to understand more how it works. There are some useful examples on the website here, I also read more about the different data structures used to handle storing the “Commits”, and the “Diff” in each repository.

I had some difficulties during the implementation, since I didn’t really know how delegate methods work, so I had to read more about them to understand what and why they’re used.

Right now, I’m trying to explore the different ways of implementing the UI, so that we enable selecting only two commits at a time to be compared. So far, I’ve found two approaches. First approach, was to provide a selection function, using the set_select_function method in the Gtk.TreeSelection Class, which is just a way to have more control over the selection of nodes.

The Second approach, was to override the button_press_event and basically use the same concept behind first approach, but this way we have even more control over what to select and what not. Since we control the selection before the clicking happens and we call the select method ourselves. I’m still not quite sure of what the best practices in gtk are, or what is the right way of doing things and especially in this particular case. So I won’t integrate any of the mentioned solutions until I get feedback from my mentors.

I’ve also mentioned Allan Day in the Project Issue, so that he could give us his insights of how the UI should look like while selecting different commits. I’m looking forward to hearing his opinion.

That being said, I’m back on track again, and I’ll be working on the UI parts of my project until I take my finals in July.

Wish me good luck.

--

--