{"thread":{"id":"37489","subject":"GSoC 2014 retrospective (Git Config API Improvements)","startedAt":"2014-09-04T19:08:43Z","lastAt":"2014-09-04T21:37:38Z","messageCount":2,"participants":["Tanay Abhra","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"248849","messageId":"CAEc54XC4PWNrDasF4Pf7Sy1bGHpOB_CWaJwiHkqF9MJ1PX9WdA@mail.gmail.com","threadId":"37489","inReplyTo":null,"subject":"GSoC 2014 retrospective (Git Config API Improvements)","fromName":"Tanay Abhra","fromEmail":"tanayabh@gmail.com","sentAt":"2014-09-04T19:08:43Z","receivedAt":"2014-09-04T19:08:43Z","isPatch":false,"sender":{"key":"tanayabh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2097229?v=4"},"body":"GSoC 2014 retrospective (Git Config API Improvements)\n-----------------------------------------------------\n\nGSoC (Google Summer Of Code) 2014 ended on 18th August. I was one of\nthree students that Git chose under GSoC 2014. My mentors were Matthieu Moy\nand Ramkumar Ramachandra. My project was Git Config API Improvements which\nwas basically improving the git_config() subsystem. The proposal can be read\non [1]. Let's see what we accomplished over the summer,\n\n1. Git config cache:\n\nI have written a config cache which reads and caches the key/value pairs\nin a hashmap. It is generalized as config-set which can also be used to read\nconfig-like files (for example submodule config files).\n\nInstead of the unwieldy git_config() callback process for querying, callers\ncan now use the new API to query config values in as straightforward manner.\n\nfor example, for querying \"foo.frotz\", we can just write,\n\nchar *value;\ngit_config_get_value(\"foo.frotz\", &value);\n\nSimilar to git_config_get_value() there are helpers which do conversion to the\ndesired type (int or bool) as well as querying.\n\nIt was introduced in master day before yesterday.\n\n2. git_config() now uses the caching layer underneath.\n\ngit_config() now uses the config-set API, thus preventing expensive rereads\nof the configuration files during a git invocation.\nIt hit \"next\" yesterday and hopefully is fit enough for master.\n\n3. git_config() calls rewrites\n\nMost of the git_config() calls in the code base that can be rewritten\nas one liners\nusing the new config-set API. Those callsites have been refactored.\n\nThe rewrites have hit \"next\" yesterday.\n\n4. Tidy git configuration files\n\nWe had to drop this one as we were pretty late into the coding period\nand we wanted\nfocus on the config-set API first. Basically it aims to correct the\ntwo broken tests in\nt1300-repo-config.sh, caused by the deficiencies in git_config_set() which are,\nsection headers are left untouched, even when all the keys related to\nit have been\nunset and adding a key into an empty section reuses the header.\n\nPath to the future\n------------------\n\nI was offline for two weeks after GSoC and I will be working on the\nfollowing topics\nin the future.\n\n1. Unsetting previously set values\n\nLocal config files can be used to unset config values previously set in system\nconfiguration files. The user may not have the privilege to touch the\nsystem files\nso he can leverage the new API to unset the previously set values.\n\n2. Rewriting the git_default_config() using the new API\n\ngit_default_config() is the most called config callback in the whole codebase,\nwhich could be easily rewritten using the new API. A rough prototype was posted\nbefore GSoC ended, hopefully the reroll would bring the series to a\nacceptable state.\n\nAny new feature suggestions??\n-----------------------------\n\nAny suggestions on features which can be added to utilize the new config-set\nAPI would be most welcome.\n\nOn-boarding\n-----------\n\nThe microprojects were very helpful in introducing the mailing list and patches\nworkflow which Git follows, to the newcomers. I got to know how code review\nand patches iterations worked and how a series evolves through iterations before\ngraduating to master.\n\nCompiling the source code was easy enough, the only part that required fiddling\nwas configuring thunderbird to send plain text mails that did not wrap\nby default.\n\nA beginner's viewpoint of the git's code\n---------------------------------------\n\nSince most of the git developers have become accustomed to seeing\ngit's codebase, I thought I should give a fresh point of view of\nhow a newbie perceives the codebase.\n\nI first read the peepcode git internals pdf[2] and the git user manual's[3]\n\"A birds-eye view of Git’s source code\" for a high level view. I also read\nFabian's Git source code overview[3] and architecture of open source programs'\nGit section[5].\n\nAfter that, for understanding a specific hunk of code, I first checked the\nDocumentation/technical section and then a liberal use of git gui blame.\nAlso sometimes when the control flow became too convoluted to follow I used\ngdb for a control flow graph or GIT_TRACE = 1.\n\nGSoC Experience\n---------------\n\nMatthieu had explained to me at the beginning of the program that I should aim\nto interact with the mailing list as soon as possible. The first prototypes and\niterations were a little slow. The first series was on the verge of\nbeing finalized\nbut was rejected due to a major discussion on the list over the design\nresulting in\na complete rewrite. Pace picked up after the midterm when the\niterations became faster.\nMy estimate says that we completed 70% of what was promised in the\nproposal before the\nGSoC ended.\n\nWhat went well: Getting working code on the list helped in catching\ncorner cases early\non. Some of the past GSoC code didn't reach master, so we had the aim\nto hitting pu\nearly on. We were mostly successful on that particular front.\n\nWhat went wrong: We had to remove some part of the original proposal\nnamely the aesthetic\nimprovements to concentrate on the config set API. The number of\ngit_config() rewrites\ncould not be larger because in many cases the callback method was the way to go.\ngit_config_early() should have been also be rewritten to use the new API.\n\nThe lesson I have learnt is that I should focus on sending out\niterations faster.\nAlso I should respond to the reviewer in a timely manner so that he is\nnot kept in dark.\n\nOverall my experience with the Git community was great. I would really\nlike to thank\nmy mentors, reviewers and the general git community for helping me with timely\nreviews, comments and checks.\n\nThe only thing that I didn't find optimal is searching for new topics\nto hack on.\nFrom reading the past mailing lists, I found the reason about why git\ndoes not has a bug\ntracker. Still, newcomers can pick topics from either Junio's list[6]\nor Matthieu's\nlist[7]. More project ideas are mentioned in the previous GSoC ideas lists.\n\nConclusion\n----------\n\nSo a great summer comes to an end. Hopefully I would still be part of\nGit's community\nand will continue working on it to improve it. I like to thank my\nmentors for being patient\nwith me and helping me whenever I got confused.\nHope you all have a great day. :)\n\nCheers,\nTanay Abhra.\n\n[1]: https://www.google-melange.com/gsoc/project/details/google/gsoc2014/tanayabh/5766466041282560\n[2]: https://github.com/pluralsight/git-internals-pdf/releases\n[3]: https://www.kernel.org/pub/software/scm/git/docs/user-manual.html#birdview-on-the-source-code\n[4]: http://fabiensanglard.net/git_code_review/\n[5]: http://aosabook.org/en/git.html\n[6]: http://git-blame.blogspot.in/p/leftover-bits.html\n[7]: https://git.wiki.kernel.org/index.php/SmallProjectsIdeas\n"},{"id":"248877","messageId":"xmqqlhpzqd7h.fsf@gitster.dls.corp.google.com","threadId":"37489","inReplyTo":"CAEc54XC4PWNrDasF4Pf7Sy1bGHpOB_CWaJwiHkqF9MJ1PX9WdA@mail.gmail.com","subject":"Re: GSoC 2014 retrospective (Git Config API Improvements)","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-09-04T21:37:38Z","receivedAt":"2014-09-04T21:37:38Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tanay Abhra <tanayabh@gmail.com> writes:\n\n> GSoC Experience\n> ---------------\n> ...\n> Conclusion\n> ----------\n>\n> So a great summer comes to an end. Hopefully I would still be part of\n> Git's community\n> and will continue working on it to improve it. I like to thank my\n> mentors for being patient\n> with me and helping me whenever I got confused.\n> Hope you all have a great day. :)\n\nHappy to see a great write-up.  Looking forward to seeing your\nfurther involvement in the community.\n\nThanks.\n"}]}