{"thread":{"id":"65255","subject":"[GSOC Proposal] Improve disk space recovery for partial clones","startedAt":"2026-03-15T19:38:30Z","lastAt":"2026-03-15T19:38:30Z","messageCount":1,"participants":["Amisha Chhajed"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"539045","messageId":"CAPvEtrdRPj6+Z3k=cqaC4a=iMC0ZAhT1NS0DRq3h2S-9F_gD6g@mail.gmail.com","threadId":"65255","inReplyTo":null,"subject":"[GSOC Proposal] Improve disk space recovery for partial clones","fromName":"Amisha Chhajed","fromEmail":"amishhhaaaa@gmail.com","sentAt":"2026-03-15T19:38:18Z","receivedAt":"2026-03-15T19:38:30Z","isPatch":false,"sender":{"key":"amishhhaaaa@gmail.com","avatar":"https://avatars.githubusercontent.com/u/136238836?v=4"},"body":"Improve disk space recovery for partial clones\n\nPersonal Information:\n—----------------------------------------------------------------------------------------------------------------------------\nName: Amisha Chhajed\nEmail: amishhhaaaa@gmail.com\ngithub: https://github.com/amishhaa\nTime Zone: UTC +5:30 (IST)\nEducation: SVKM's Dwarkadas J. Sanghvi College of Engineering\nYear: 3rd year, 6th semester\nDegree: Bachelor of Technology in Artificial Intelligence and Data Science\n\nAbout me and past experience:\n—----------------------------------------------------------------------------------------------------------------------------\nHello, I am Amisha, currently in my penultimate year of engineering.\nI am deeply passionate about contributing to open source and find great\nfulfillment when I see my code helping people. Given this motivation, I have\ncontributed to various open source projects and the experience has been\nextremely rewarding and ethereal.\nApart from open source, I make art and I like building games.\n\nI am currently doing my LFX at OpenTelemetry, my project is about building a\nGO CLI tool that runs tests of the dependents of a library to record\nany regresisons caused by new changes in the library (more about my project:\nhttps://mentorship.lfx.linuxfoundation.org/project/5f537fc2-548b-487a-99ed-c61f7e8bcd47)\n(list of PRs created until now:\nhttps://github.com/open-telemetry/opentelemetry-go-build-tools/issues?q=is%3Apr+author%3Aamishhaa).\nI interned at Google for summer of 2025 under team workspace serving\ninfrastructure.\n(Completion certificate:\nhttps://drive.google.com/file/d/10Nze1RzAehyN_BogP4Qlc0fHFYYuJ5Rw/view?usp=sharing)\nSome open source contributions that I am most proud of are in bitcoin core\n(refer credits: https://bitcoincore.org/en/releases/29.2/\nmy PR: https://github.com/bitcoin/bitcoin/pull/33482) and git :)\n\nMy contributions in git:\n* cat-file: exit code of 'git cat-file' is suppressed by piping it\ndirectly into grep.\n*Status: Awaiting review\n*Mailing List: https://lore.kernel.org/git/20260113180409.36683-1-amishhhaaaa@gmail.com/\n*Log: This was the first patch i ever created for git as amicroproject,\nmade me familiar with the mailing list workflow.\n\n* sparse-checkout: optimize string_list construction and add tests to\nverify deduplication.\n*Status: merged in 'master'\n*Mailing List: https://lore.kernel.org/git/20260121130005.72375-1-amishhhaaaa@gmail.com/\n*Log: This is a really important patch for me, improves O(n^2)\ncomplexity to O(n log n) of sparse-checkout by building a\nsorted 'string_list' by constructing it unsorted then sorting it\nfollowed by removing duplicates, this triggered a series of patches\nand uncovered various bugs when i worked on replacing\ncalls of string_list_sort() and string_list_remove_duplicates()\nwith string_list_sort_u().\n\n*u-string-list: add unit tests for string-list methods.\n*Status: merged in 'master'\n*Mailing List: https://lore.kernel.org/git/20260129121220.69267-1-amishhhaaaa@gmail.com/\nLog: Adding unit tests for string-list methods which i saw were not\npresent when i was creating a new API string_list_sort_u.\n\n* string-list: add string_list_sort_u() that mimics \"sort -u\"\n*Status: merged in 'master'\n*Mailing List: https://lore.kernel.org/git/20260129121220.69267-2-amishhhaaaa@gmail.com/\nLog: Adding a new API string_list_sort_u and cleaning up the call\nsites that can directly adopt this new replacement,\nstring_list_sort_u mimics sort -u.\n\n*sparse-checkout: use string_list_sort_u\n*Status: merged in 'master'\n*Mailing List: https://lore.kernel.org/git/20260212041017.91370-2-amishhhaaaa@gmail.com/\n*Log: Small fix to replace a callsite of string_list_sort and\nstring_list_remove_duplicates with string_list_sort_u.\n\n*help: cleanup the construction of keys_uniq\n*Status: Will merge to 'next'.\n*Mailing List: https://lore.kernel.org/git/20260311192453.62213-1-amishhhaaaa@gmail.com/\n*Log: Cleaning up complex callsites of string_list_sort and\nstring_list_remove_duplicates, this\none involved finding a test case that demonstrated a breakage,\nhttps://lore.kernel.org/git/CAPvEtrenMBMFaMxcCR4VwoyMFU-_Z+bqq5nJaWv5eyn3HRutEA@mail.gmail.com/,\nthen replacing them with string_list_sort_u, another bug found as an effort is\nhttps://lore.kernel.org/git/CAPvEtrfEZXHxcDf=z60ODfUA8cS81rhF1y7KEZApEBby7aCa1A@mail.gmail.com/,\nThis is still a pending bug which is good to work around in future, I\nhave provided a test to demonstrate an existing breakage.\n\nHistory/Background and Overview:\n—----------------------------------------------------------------------------------------------------------------------------\nBuilding partial clone was a community effort, with contributions\nreferenced here,\nhttps://git-scm.com/docs/partial-clone#_related_links,\neven though partial clone is working, there is currently no direct way\nto evict the acquired blobs and reduce the disk space that\nwe bloated by constant use.\n\nThe \"Partial Clone\" feature is a performance optimization for Git that\nallows Git to function without having a complete copy of the\nrepository, however overtime a lot of blobs might be fetched and\ncurrently there is no functionality that, first checks if a blob\nis present on a promisor and then we can remove it safely to free up\nour disk space, fundamentally users who make a partial clone want\nto save up space so being able to remove the acquired blobs on\ndemand would be a great addition.\n\nThis project aims to implement a command 'git evict' that can carry\nout safe removal of the blobs from our disk space such that it can\nbe fetched later on from any of the remotes if needed, dynamically.\n\nProposed Plan:\n—----------------------------------------------------------------------------------------------------------------------------\nWhenever we are evicting something we are unsure of its usefullness to\nusers, unless obvious, which git gc already handles. To overcome this,\nwe can make a new command 'git evict', essentially this command gives\nusers options and freedom to evict blobs that they no longer require,\nwhether it is out of cone or not on a checkout and a lot of other\nsituations, instead of predicting what users may or may not need we can\ngive them the choice of removal. In a case where users have a\ncone and have set up a maintenance task of evicting blobs outside of\ncone, in that case we can make it automatic.\n\nThis command would check for presence of promisor remotes for blobs\nthat user has set to remove, if a promisor is promising that object we can\nevict it, otherwise we keep it. This would also require users\nto be online, as we cannot and should not evict something that is not promised.\n\nAs git currently treats remotes as source of truth(.promisor), we also\ntrust those remotes when evicting blobs because if all the remotes break\nthe principal of not strictly presenting the promised objects then\nthe partial clone is inherently broken, we can display a warning that\nremote might not be able to fetch your file again if it gets deleted there\nwhile evicting based on .promisor file.\n\nCurrently on the user interface I am planning to implement these\nflags, inspired heavily from reversing how we partial clone, for say\nwhen partial cloning i set blob:limit=<size> then i might want to evict blobs\ngreater than that size in future.\n* --outside-cone: Evict blobs that are not part of the current\nsparse-checkout cone.\n* --older-than=<time>: Evict blobs that haven't been referenced by a\ncommit in the last N days.\n(Suggested :- https://lore.kernel.org/git/735eb76e-44a9-4f79-b769-23a3a07437ae@gmail.com/)\n* --large-only=<size>: Evict blobs that are bigger than a certain size.\n* --tree-depth=<n>: Evict blobs with depth > n\n\nThis project can essentially be split into two parts:\n* Given an object, we can use method is_promisor_object() to check if\nit is promised, if yes we can repack our packfiles without that object,\nhowever we cannot repack for every object hence first we need to gather\na list of objects and after running is_promisor_object() for each of\nthem, we can repack without the objects we are evicting.\n* Now comes gathering the list of objects, for each command written\nabove we would need a different method to find and append the object\nto evict, in the object list. For example, for objects --large-only=<size>,\nwe need to find objects that are larger than the size specified and mark it for\neviction, similar methods to handle such filters have been written in our\ncodebase and can be used as reference.\n\nProject Timeline:\n—----------------------------------------------------------------------------------------------------------------------------\n* Community Bonding (Until May 24)\nDiscuss project ideas and design implementation details with mentors,\npossible subcommands to keep and the overall architecture of command,\nany optimizations we can make when repacking objects.\n\n* Coding Period (May 25 - August 16)\nThe implementation flow can be divided as,\n* Implement evict_objects method and is_safe_to_evict method.\n* Implement different ways to gather and pass the objects to the\nevict_objects method.\n* implement git evict command.\n* All stages would be accompanied by necessary documentation and unit tests.\n\n* Final Week (August 17 - August 24)\nThis is a buffer period for any unforeseen delays and to prepare a\nfinal report of everything we have accomplished over the summer :)\n\nAvailability:\n—----------------------------------------------------------------------------------------------------------------------------\nI would be dedicating 45 hours per week of my time to this project\nweekly. I don't have any other commitments apart from LFX in the month\nof May which would be easy to manage given my summer break.\n\nPost-GSOC and Appreciation:\n—----------------------------------------------------------------------------------------------------------------------------\nI want my journey with git to be a long one, it is very fulfilling for\nme to see my code running on many devices, It is like a dream come\ntrue for me, so even post GSOC I intend to keep contributing to git.\n\n-- \nThanks,\nAmisha\n"}]}