bobbingwide / oik-batch

Batch interface to WordPress
https://www.oik-plugins.com/oik-plugins/oik-batch
GNU General Public License v2.0
0 stars 0 forks source link

Improve performance parsing git based repositories #1

Closed bobbingwide closed 8 years ago

bobbingwide commented 8 years ago

The Dynamic API Reference in wp-a2z.org is getting quite stale. One of the main reasons for this is the time it takes to parse large plugins which contain many files with many APIs and classes. Most of these plugins are developed using git, having repositories on GitHub. We can use git commands to identify the files that have changed since a particular version. This will be lot quicker than the current process.

Proposed solution

In createapis2 and listapis2 check to see if the repository is a git repo. If so, find the list of changed files using git commands. If not, then use the original code. This will entail writing a simple set of functions to invoke git commands.

Since most of the repositories are tagged with releases then all we really need to do is perform

git diff --name-only previous-tag

where previous-tag is the most recently documented version.