{"thread":{"id":"59527","subject":"[RFC][GSoC Proposal V1] : Unify ref-filter formats with other pretty formats","startedAt":"2023-04-03T10:46:49Z","lastAt":"2023-04-03T18:13:23Z","messageCount":2,"participants":["Vinayak Dev"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"474679","messageId":"CADE8NaopF=xRJQvM1SbDYj6+O0dqSOJA0AY7roorLDc0G4oEPA@mail.gmail.com","threadId":"59527","inReplyTo":null,"subject":"[RFC][GSoC Proposal V1] : Unify ref-filter formats with other pretty formats","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-04-03T10:46:29Z","receivedAt":"2023-04-03T10:46:49Z","isPatch":false,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"Hello everyone! I am sorry for being off the mailing list for so long,\nmy University exams were going on. This is a draft for my proposal for\nGSoC 2023, with Git as my mentoring organisation. Thanks a lot!\n\n-- Unify ref-filter formats with other pretty formats --\n\n-- Personal Information --\n==========================\nName:               Vinayak Dev\nEmail:                vinayakdev.sci@gmail.com\nGithub:              @vinayakdsci\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 added a new `signature` atom to ref-filter.c. His work allows to get\nrid of the implementation of the `signature` atom in pretty.c,\nmoving it to ref-filter.c for better unification of the logic with\nother 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 to 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 a peek 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, how\nhe adds new formatting specifiers in pretty-formatting.\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-- Timeline --\n==============\nApril 5 - May 4 - Contribute small but meaningful patches regularly,\n                  as this is the best way to get comfortable with\n                  the source code. Also, this would give me an\n                  opportunity to interact freely with the mentors and\n                  reviewers on the mailing list.\n\nMay 4 - May 28 -  (Community Bonding) This is one of the most important\n                  phases  for any GSoC contributor, as interaction with\n                  mentors and reading the documentation is as important\n                  as implementing the code for the idea. During this,\n                  I intend to start looking for duplicate implementations\n                  in the source code for pretty formatting, that must\n                  be moved to ref-filter.c, along with unsupported atoms.\n\nMay 29 - July 13 - The target is to re-implement the duplicate logic,\n                  but it is important to keep the track of time.\n                  so, (after reading Hariom's and Olga's blogs) the best\n                  approach is to divide the work into weeks with coding,\n                  testing, and bug-fixing on specific week-days.\n                  This would help maintain a good speed, while still\n                  ensuring that the code is properly written.\n                  Also, pretty formats might have some atoms that are not\n                  supported by ref-filter, so begin by implementing some\n                  of them, and cleaning up the related logic.\n\nJuly 14 - August 21-\n                  Final work period involves wrapping up the code, and\n                  writing extra tests to make sure that no new errors\n                  are introduced into the code base. Also, it must\n                  be made sure that none of the old functionality\n                  breaks, so all the original tests have to pass, too.\n\nAugust 22 - August 28-\n                  This is the last week of the journey of GSoC,\n                  and the most important part is to ensure that the\n                  changes that have been made to the code base\n                  integrate well with the existing code. I hope\n                  to write good enough code to allow for this phase\n                  to finish seamlessly.\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, 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\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"},{"id":"474702","messageId":"CADE8NapU_5HVw_GEjT=ai2vB-eNTYLL2nk_5xDCHx-cTecQMfQ@mail.gmail.com","threadId":"59527","inReplyTo":"CADE8NaopF=xRJQvM1SbDYj6+O0dqSOJA0AY7roorLDc0G4oEPA@mail.gmail.com","subject":"Re: [RFC][GSoC Proposal V1] : Unify ref-filter formats with other pretty formats","fromName":"Vinayak Dev","fromEmail":"vinayakdev.sci@gmail.com","sentAt":"2023-04-03T18:13:03Z","receivedAt":"2023-04-03T18:13:23Z","isPatch":false,"sender":{"key":"vinayakdev.sci@gmail.com","avatar":"https://avatars.githubusercontent.com/u/104419489?v=4"},"body":"I am extremely sorry, I forgot to put in the link to the actual\nproposal. Here it is!\n\n\n\nOn Mon, 3 Apr 2023 at 16:16, Vinayak Dev <vinayakdev.sci@gmail.com> wrote:\n>\n> Hello everyone! I am sorry for being off the mailing list for so long,\n> my University exams were going on. This is a draft for my proposal for\n> GSoC 2023, with Git as my mentoring organisation. Thanks a lot!\n>\n> -- Unify ref-filter formats with other pretty formats --\n>\n> -- Personal Information --\n> ==========================\n> Name:               Vinayak Dev\n> Email:                vinayakdev.sci@gmail.com\n> Github:              @vinayakdsci\n> Ph no:               +91-9119055909\n> Education:         Bachelor of Technology,\n>                           Computer Science and Engineering\n>                           University of Engineering and Technology, Roorkee.\n> Year/Semester: 2nd/IV\n>\n>\n> -- Overview/Synopsis --\n> =======================\n> Git has had the problem of different implementations to format command\n> outputs for different commands in the past. Through the efforts of the\n> community members and the past GSoC and Outreachy participants, much\n> of the formatting logic has been unified into ref-filter.c, allowing the\n> code base to get rid of duplicate implementations.\n>\n> The current task of the project is to continue this effort and use the\n> formatting logic from ref-filter.c in pretty.c, to allow getting rid of\n> duplicate formatting logic.\n>\n> Outreachy participant Olga Telezhnaya and GSoC participant Hariom Verma\n> provide a good insight into the logic and approach required for using\n> ref-filter formatting logic with other commands, like git cat-file, etc.\n> Olga also makes an attempt to generalize the formatting logic in\n> ref-filter.c to allow for migration to other commands easier.\n>\n> Their blogs at [1] and [2] are a good starting point to understand the\n> structure and the history of the work on this idea.\n>\n> Nsengiyumva Wilberforce also sent patches to the mailing list[3] where\n> he added a new `signature` atom to ref-filter.c. His work allows to get\n> rid of the implementation of the `signature` atom in pretty.c,\n> moving it to ref-filter.c for better unification of the logic with\n> other commands.\n>\n> Also, the discussion[4] on the mailing list, with a patch series\n> concerning pretty.c by Anders Waldenborg add and improve upon the\n> features of git's pretty-formatting, with insightful comments about the\n> process from the reviewers, Eric Sunshine, Junio C Hamano, and\n> Jeff 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> =================\n> I joined the Git community in February 2023, and have since then been\n> hugely inspired by the efficient and strong workflow, and how the\n> members encourage newcomer's contributions, despite Git being such a\n> large scale and important project.\n>\n> To understand the source code, I have referred to many sources, some of\n> them being the Reference Manual, Git Internals, Hacking Git, and the\n> Pro Git book by Scott Chacon, all of which provide a good and deep\n> insight into the working of a git, both on the level of the terminal\n> commands, and the source code. (including MyFirstObjectWalk)\n>\n> I have submitted following patches to Git:\n>\n> 1. [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>\n> 2. [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\n> constants, if they are enums).\n>    Status: WIP\n>\n>\n> -- Benefits to the Community --\n> ===============================\n> Git is a great and big community, where people volunteer to maintain\n> one of the best and well-written codebase of all open-source projects.\n> I, too, aspire to be a permanent part of the community, and leave a\n> lasting effect on the developer community. Since I joined the mailing list,\n> I have loved the way people communicate and work together here.\n>\n> So, I want to remain a part of the Git community irrespective of if I am able\n> to make it as a GSoC contributor or not, as I am sure that Git will help\n> me become a better programmer, and a thinker in general.\n>\n> This project is important as in my viewpoint removing duplicate logic\n> and unifying it helps improve the modularity of the code base, and make it\n> sleeker, which is one of the best qualities of the Git code base.\n> The project would help newcomers understand code easily, and remove scope\n> for error-prone or failing code, which often results from duplicate logic.\n>\n>\n> -- Previous Work --\n> ===================\n> GSoC candidate Hariom Verma and Outreachy student Olga Telezhnaya\n> did important work in the direction of unifying formatting\n> logic into ref-filter.c and removing duplicate implementations in\n> other commands. Most importantly, Hariom's work, where he tries to\n> create a transition table(pretty-lib.c) between pretty.c and\n> ref-filter.c is important and highly relevant to this project.\n> It provides a good starting point and gives an insight into the code\n> in pretty.c and ref-filter.c.\n>\n> His blogs(mentioned above) provide a peek into the way of thinking\n> he adopts, as he implements the logic. This helps to understand the\n> way of thinking of another person, which again provides knowledge.\n>\n> Olga's work is important as it describes how the student might face\n> difficulties, especially during bug fixing. This makes me confident\n> and less hesitant to ask on the mailing list and to the mentors.\n> Also, she describes how she generalises the logic of ref-filter.c\n> to allow for better integration to other commands, like git cat-file.\n> The blog posts also emphasise the need for comfort with a debugger like\n> GDB, but that is alright.\n>\n> Hariom has clearly described, and given a link to his commits, how\n> he adds new formatting specifiers in pretty-formatting.\n>\n>\n> -- Proposed Work --\n> ===================\n> As Christian Couder mentions on the mailing list, one of the most\n> important parts while removing duplicate logic in pretty.c is to ensure\n> that ref-filter.c has to support all the atoms that pretty-formats have.\n>\n> This is in accordance with the work of Nsengiyumva Wilberforce,\n> who outside of Outreachy has sent patches to implement the `signature`\n> atom in ref-filter.c. This patch-series is therefore an important\n> reference for much of the work in this project.\n>\n> Therefore the target/proposed work is to implement at least some of the\n> atoms supported by pretty-formats into ref-filter.c, and then clean up\n> the duplicate logic. This should provide a neat and clean way of working\n> when applied incrementally.\n>\n>\n> -- Timeline --\n> ==============\n> April 5 - May 4 - Contribute small but meaningful patches regularly,\n>                   as this is the best way to get comfortable with\n>                   the source code. Also, this would give me an\n>                   opportunity to interact freely with the mentors and\n>                   reviewers on the mailing list.\n>\n> May 4 - May 28 -  (Community Bonding) This is one of the most important\n>                   phases  for any GSoC contributor, as interaction with\n>                   mentors and reading the documentation is as important\n>                   as implementing the code for the idea. During this,\n>                   I intend to start looking for duplicate implementations\n>                   in the source code for pretty formatting, that must\n>                   be moved to ref-filter.c, along with unsupported atoms.\n>\n> May 29 - July 13 - The target is to re-implement the duplicate logic,\n>                   but it is important to keep the track of time.\n>                   so, (after reading Hariom's and Olga's blogs) the best\n>                   approach is to divide the work into weeks with coding,\n>                   testing, and bug-fixing on specific week-days.\n>                   This would help maintain a good speed, while still\n>                   ensuring that the code is properly written.\n>                   Also, pretty formats might have some atoms that are not\n>                   supported by ref-filter, so begin by implementing some\n>                   of them, and cleaning up the related logic.\n>\n> July 14 - August 21-\n>                   Final work period involves wrapping up the code, and\n>                   writing extra tests to make sure that no new errors\n>                   are introduced into the code base. Also, it must\n>                   be made sure that none of the old functionality\n>                   breaks, so all the original tests have to pass, too.\n>\n> August 22 - August 28-\n>                   This is the last week of the journey of GSoC,\n>                   and the most important part is to ensure that the\n>                   changes that have been made to the code base\n>                   integrate well with the existing code. I hope\n>                   to write good enough code to allow for this phase\n>                   to finish seamlessly.\n>\n>\n> -- Blogging --\n> ==============\n> Like many participants on this mailing list, and programmers in general\n> I also find the idea of blogging about new topics and recent findings\n> to be an extremely enriching process. However, till now, I was just\n> playing with the idea of starting a blog, but now I am confident enough\n> to go ahead and start one. I intend to host it on github, and post\n> new information and updates about my progress regularly(weekly seems best).\n> Many people I know have progressed incredibly through blogging and sharing,\n> and I take huge inspiration from that.\n>\n>\n> -- Closing --\n> =============\n> Becoming a contributor to Git has been extremely meaningful to me.\n> It is the first real software that I have actually been a part of,\n> and interacting with people in the Git community has been a great and\n> memorable time. I hope to keep contributing actively, and remain a part\n> of the community as long as I can, maybe forever!\n>\n> Thanks a lot!\n> Vinayak\n"}]}