GSoC Week 16

One last time

The final evaluations start on August 24 , i.e., in 2 days. GSoC was a fantastic rollercoaster ride. I learned so much about Git, C, shell scripting, Linux and programming in general. It was the best learning experience I have had to date. There were many highs and lows throughout this whole journey and gladly my mentors, Christian Couder and Kaartic Sivaraam helped me get through it all.

This is the final edition of my GSoC blog series since for next week I have to write a blog to summarise, my GSoC project and the experience. Therefore, for one last time, I will give an account of the work I have done in the past week.

This week went fine in terms of GSoC. The summary patch series will graduate to master as stated in the “What’s cooking” mail dated August 22 (IST). The t7401 patch series also looks good, and its v3 will also get into the pipeline (currently in seen). I am happy that I have been able to contribute a significant amount to Git during my two months as a GSoC student.

The summary patch required some small yet significant changes as well, which I will discuss below. Currently, I am working on the conversion of git submodule add to C, and I feel I am close to done with that as well.

Changes in summary

It started with Peff (Jeff King) reporting the presence of unused parameters missing_src and missing_dst in the definition of print_submodule_summary(). Hence I had to create a fixup patch which removes this. In the meantime, Dscho (Johannes Schindelin) reported that my summary port failed to satisfy t7421.4 on Windows. This was due to an error message which prints differently on Windows and Unix-like systems. When we try to manipulate/enter a non-existent directory during calculating the summary, this is what we are met with on *nix:

fatal: exec 'rev-parse': cd to '<dir-name>' failed: No such file or directory

Whereas, on Windows:

error: cannot spawn Git: No such file or directory

Therefore, in test 4 of t7421-submodule-summary-add.sh, I tried to grep the keywords of the message:

test_i18ngrep "fatal:.*<dir-name>" err

As you may have already noticed by now, the grep pattern to be checked is heavily *nix specific and will 100% fail on Windows and so it did. Therefore, Kaartic advised deleting the grep check as well as, change the if-statement in verify_submodule_committish()which originally was:

if (capture_command(&cp_rev_parse, &result, 0))

to:

if (!is_directory(sm_path) || capture_command(&cp_rev_parse, &result, 0))

This way, the error message from running rev-parse is suppressed since it is short-circuited in the case when the directory we are trying to run rev-parse in does not exist and NULL is returned.

Also, a small cosmetic change was needed to be done in the definitions of verify_submodule_committish() and print_submodule_summary():

static char* verify_submodule_committish(const char *sm_path, const char *committish)

Here, the asterisk is placed beside the return type instead of the function name and this needs to be corrected.

static void print_submodule_summary(struct summary_cb *info, char* errmsg)

As one may notice, the asterisk before errmsg is placed wrongly and should be placed beside the variable rather than its data type. This was reported by Kaartic.

Work on add

I picked up on the work left by Prathamesh Chavan on git submodule add and made it pass the all the required tests. The work is well written but lacked coverage of various cases as well had redundancy in some areas. I fixed it all and made all the tests work.

Currently, I was trying to eliminate the check_already_existing_submodule() function and use other, already existing functions to make things work. The function spawned a child process and ran git ls-files. I wanted to do the same but without the spawn. I have achieved it though there is a slight chance that things may be a bit off there too. I will confirm this and then post the patch on the List.

Next steps

What’s next? Keep contributing to Git! Though I will have to take a break due to the upcoming exams for internships as well as a short vacation sometime later; I will not disappear from the project!

I do have a couple of things in mind apart from the full conversion of git submodule to C, which I will try to implement later. Let’s see how that goes!

On a final note, this project taught me tons of things not limited to Computer Science or programming, etc. I am incredibly thankful to my mentors (and trust me when I say this) for tolerating all the dumbness of mine and placing their hopes in me. It was a great ride!

Over and out,
Shourya Shukla

Comments

Popular posts from this blog

The Final Report

GSoC Week 4 [One month special]

GSoC Week 10