Skip to content
Vlad's Blog
GithubLinkedInHomepage

Small tool for finding orphans in the projects managed by repo

android, repo, devtools1 min read

Many large projects, such as Android AOSP, use repo tools to manage thousands of small repositories that make up the project. The tool is great, but the workflow is somewhat unusual when compared to the standard Git workflow. One common issue with using this tool over the lifetime of the multi-year projects is that developers add new components but fail to register subprojects in the repository manifest. These unregistered projects, also known as orphan projects, cause issues with repo synchronization and update tasks because the tool is unaware of their existence. This problem worsens over time as these small projects lurk on developers' laptops, causing the project tree to diverge from the rest of the team and build servers, and eventually get lost when the developer gets a new machine.

A feature request was submitted to the repo developers years ago to address this issue, but it has not been addressedfor several years. To finally resolve this issue, I built a small tool that scans the repository for orphan directories and returns a list of them. Developers can use this list to clean up their project, either by removing orphans or adding them to the manifest.

You can download this tool from PyPi or Github.

I hope you find it useful.

Comments powered by Talkyard.