{"thread":{"id":"59533","subject":"[GSoC Proposal V2] Unify ref-filter formats with other pretty formats","startedAt":"2023-04-04T08:32:36Z","lastAt":"2023-04-04T08:32:36Z","messageCount":1,"participants":["Vinayak Dev"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"474765","messageId":"CADE8NaqxPo0K-tcjGzD_D+5rt_bFyGrKzMmmw3a46AuBX_=+Rw@mail.gmail.com","threadId":"59533","inReplyTo":null,"subject":"[GSoC Proposal V2] Unify ref-filter formats with other pretty formats","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-04-04T08:32:16Z","receivedAt":"2023-04-04T08:32:36Z","isPatch":false,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"Hello everyone!\nThis is V2 of my proposal for GSoC 2023. I try to make the timeline a\nlittle more precise and unambiguous, and add clear deliverables.\n\nThe proposal can be read at:\n\nhttps://docs.google.com/document/d/e/2PACX-1vQB-LTb_pu6dISl-viI7K7lmA0dUgfgkeCBnaUoLSWl6Rq7MMuQZOuQ4FAqIiXYri4V7qSa-jzCabK-/pub\n\nThanks a lot!\n\n\n\n-- Unify ref-filter formats with other pretty formats --\n\n\n-- Personal Information --\n==========================\nName:                 Vinayak Dev\nEmail:                vinayakdev.sci@gmail.com\nGithub:               @vinayakdsci\nCountry of Residence: India\nPh no:                  +91-9119055909\nEducation:            Bachelor of Technology,\n                            Computer Science and Engineering\n                            University of Engineering and Technology, Roorkee.\nYear/Semester:        2nd/IV\n\n\n-- Overview/Synopsis --\n=======================\nGit has had the problem of different implementations to format command\noutputs for different commands in the past. Through the efforts of the\ncommunity members and the past GSoC and Outreachy participants, much\nof the formatting logic has been unified into ref-filter.c, allowing the\ncode base to get rid of duplicate implementations.\n\nThe current task of the project is to continue this effort and use the\nformatting logic from ref-filter.c in pretty.c, to allow getting rid of\nduplicate formatting logic.\n\nOutreachy participant Olga Telezhnaya and GSoC participant Hariom Verma\nprovide a good insight into the logic and approach required for using\nref-filter formatting logic with other commands, like git cat-file, etc.\nOlga also makes an attempt to generalize the formatting logic in\nref-filter.c to allow for migration to other commands easier.\n\nTheir blogs at [1] and [2] are a good starting point to understand the\nstructure and the history of the work on this idea.\n\nNsengiyumva Wilberforce also sent patches to the mailing list[3] where\nhe adds a new `signature` atom to ref-filter.c. He was unable to fulfill\nthe requirements for the Outreachy programme, but sent the patches\nnonetheless. His work allows to get rid of the implementation of the\n`signature` atom in pretty.c, moving it to ref-filter.c for better\nunification of the logic with other commands.\n\nAlso, the discussion[4] on the mailing list, with a patch series\nconcerning pretty.c by Anders Waldenborg add and improve upon the\nfeatures of git's pretty-formatting, with insightful comments about the\nprocess from the reviewers, Eric Sunshine, Junio C Hamano, and\nJeff King.\n\n[1] https://medium.com/@olyatelezhnaya\n[2] https://harry-hov.github.io/blogs/posts/\n[3] https://lore.kernel.org/git/?q=f%3A+Nsengiyumva+Wilberforce\n[4] https://lore.kernel.org/git/20181104152232.20671-1-anders@0x63.nu/T/#u\n\n\n-- Before GSoC --\n=================\nI joined the Git community in February 2023, and have since then been\nhugely inspired by the efficient and strong workflow, and how the\nmembers encourage newcomer's contributions, despite Git being such a\nlarge scale and important project.\n\nTo understand the source code, I have referred to many sources, some of\nthem being the Reference Manual, Git Internals, Hacking Git, and the\nPro Git book by Scott Chacon, all of which provide a good and deep\ninsight into the working of a git, both on the level of the terminal\ncommands, and the source code. (including MyFirstObjectWalk)\n\nI have submitted following patches to Git:\n\n1. [PATCH] t9160: Change test -(d | f) to test_path_is_*\n   Description: The patch was intended to be a microproject for Git for GSoC.\n                It replaces the test -f and test -d commands in t/t9160\n                to helper functions described in t/test-lib-functions.sh,\n                which provide better diagnostic, and error messages.\n   Status: Discontinued\n\n2. [PATCH v3] apply: Change #define to enum and variable types from int to enum\n   Description: The patch changed preprocessor constants defined in apply.c\n                to enums, along with changing the types of variables to the\n                respective enum types, to allow for easier debugging in case of\n                errors (many debuggers support listing out the\nconstants, if they are enums).\n   Status: WIP\n\n\n-- Benefits to the Community --\n===============================\nGit is a great and big community, where people volunteer to maintain\none of the best and well-written codebase of all open-source projects.\nI, too, aspire to be a permanent part of the community, and leave a\nlasting effect on the developer community. Since I joined the mailing list,\nI have loved the way people communicate and work together here.\n\nSo, I want remain a part of the Git community irrespective of if I am able\nto make it as a GSoC contributor or not, as I am sure that Git will help\nme become a better programmer, and a thinker in general.\n\nThis project is important as in my viewpoint removing duplicate logic\nand unifying it helps improve the modularity of the code base, and make it\nsleeker, which is one of the best qualities of the Git code base.\nThe project would help newcomers understand code easily, and remove scope\nfor error-prone or failing code, which often results from duplicate logic.\n\n\n-- Previous Work --\n===================\nGSoC candidate Hariom Verma and Outreachy student Olga Telezhnaya\ndid important work in the direction of unifying formatting\nlogic into ref-filter.c and removing duplicate implementations in\nother commands. Most importantly, Hariom's work, where he tries to\ncreate a transition table(pretty-lib.c) between pretty.c and\nref-filter.c is important and highly relevant to this project.\nIt provides a good starting point and gives an insight into the code\nin pretty.c and ref-filter.c.\n\nHis blogs(mentioned above) provide an insight into the way of thinking\nhe adopts, as he implements the logic. This helps to understand the\nway of thinking of another person, which again provides knowledge.\n\nOlga's work is important as it describes how the student might face\ndifficulties, especially during bug fixing. This makes me confident\nand less hesitant to ask on the mailing list and to the mentors.\nAlso, she describes how she generalises the logic of ref-filter.c\nto allow for better integration to other commands, like git cat-file.\nThe blog posts also emphasise the need for comfort with a debugger like\nGDB, but that is alright.\n\nHariom has clearly described, and given a link to his commits[5], how\nhe adds new formatting specifiers in pretty-formatting.\n\n\n[5] https://github.com/harry-hov/git/tree/pretty-lib-2.0.0\n\n\n-- Proposed Work --\n===================\nAs Christian Couder mentions on the mailing list, one of the most\nimportant parts, while removing duplicate logic in pretty.c is to ensure\nthat ref-filter.c has to support all the atoms that pretty-formats have.\n\nThis is in accordance with the work of Nsengiyumva Wilberforce,\nwho outside of Outreachy has sent patches to implement the `signature`\natom in ref-filter.c. This patch-series is therefore an important\nreference for much of the work in this project.\n\nTherefore the target/proposed work is to implement at least some of the\natoms supported by pretty-formats into ref-filter.c, and then clean up\nthe duplicate logic. This should provide a neat and clean way of working\nwhen applied incrementally.\n\n\n-- Deliverables --\n==================\n\n*   Support for atoms in pretty.c moved to ref-filter.c\n*   Removal of  duplicate logic in pretty.c\n*   Teach pretty,c to take formatting logic from ref-filter.c\n*   Proper documentation for the new changes\n*   No new breakages introduced in the code-base\n\n\n-- Timeline --\n==============\nApril 5 - May 4 -\nKeep contributing small but meaningful patches,\nas this is the best way to get comfortable with\nand gain more familiarity with Git’s source, especially\nref-filter.{c,h} and pretty,{c,h}\n\nMay 4 - May 28 -\nLook for atoms in pretty.c that are unsupported in\nref-filter. This is important, as atoms must be supported\nbefore the formatting logic is re-written in ref-filter.c\nRead and understand the documentation and previous\nwork and related commits in the history of Git.\n\nMay 29 - July 13 -\nAdd support for and implement atoms from pretty.c\nto ref-filter.c. Write new tests to ensure that logic is\nnot broken. Ensure that all old tests pass.\n\nJuly 14 - August 21-\nImplement duplicate formatting logic from pretty,c in\nref-filter.c, now that atoms are supported.\nUpdate documentation related to the changes, and\nwrite new tests, while again still ensuring that none of\nthe old tests fail.\n\nAugust 22 - 28\nClean up any mess in the codebase, if present.\nRemove redundant/unneeded code and format the\ncode to make it more readable and easier to understand.\n\n\n-- Blogging --\n==============\nLike many participants on this mailing list, and programmers in general\nI also find the idea of blogging about new topics and recent findings\nto be an extremely enriching process. However, till now, I was just\nplaying with the idea of starting a blog, but now I am confident enough\nto go ahead and start one. I intend to host it on github[6], and post\nnew information and updates about my progress regularly(weekly seems best).\nMany people I know have progressed incredibly through blogging and sharing,\nand I take huge inspiration from that.\n\n[6] https://vinayakdsci.github.io/\n\n-- Closing --\n=============\nBecoming a contributor to Git has been extremely meaningful to me.\nIt is the first real software that I have actually been a part of,\nand interacting with people in the Git community has been a great and\nmemorable time. I hope to keep contributing actively, and remain a part\nof the community as long as I can, maybe forever!\n\nThanks a lot!\nVinayak\n"}]}