Git transclusion in MediaWiki/Proposal

From MediaWiki.org
Jump to navigation Jump to search

Summary[edit]

My project is a git repository extension that will allow users to add and maintain pieces of code from a git repository to a wiki page. I've written code in Python that will pull a git repository and extract a snippet of code or the whole file given a git url, a file name, a branch name, and the start and end line for the snippet. The branch name is optional and is set to 'master' by default. If no line range is given, the entirety of the file's contents will be returned. The user can also chose to indicate the start or end line, in which the defaults for start is at the top of the file and the end is at the bottom.

Currently, I'm in the process of learning PHP and how to convert my Python code to Mediawiki's codebase. For updates on my progress, I highly recommend reading my blog: Teresa Explores FOSS. I also update it with all my thoughts on FOSS and contributing to FOSS.

Proposed Timeline[edit]

Week Task
1 Mark will help me navigate through the main structure of the git extension project, and how it will mesh with Wikimedia's products.
2-3 With the help of my mentor, I will be writing the base functionality of the extension. I will be updating my initial script to PHP and polishing it. Since I'm not familiar with PHP, I'll be spending time learning PHP as well. Currently, the script deletes the repository when it's done, but ideally, we'd like to keep a working copy and updating periodically.
4-End Once I've completed the base program, I'll be researching the best ways to store and update git repositories along with things like clearing out unused repositories and ensuring that disk space doesn't exceed a certain quota. Then the rest of the time will be devoted to improving the extension with more features or optimizations, I've considered a few options such as extending this to work with Mercurial, and adding in an option to update the wiki's git repositories whenever there's a change. There will probably be extensive testing done during this time as well.