Oxen-AI / Oxen

Oxen.ai's core rust library, server, and CLI
https://oxen.ai
Apache License 2.0
178 stars 11 forks source link

Improve commit history endpoint #366

Closed EloyMartinez closed 2 months ago

EloyMartinez commented 3 months ago

3 main changes.

The structure of the route changes to avoid collision with branches that contain a slash and "history" in their name

We improve the logic to retrieve the latest commit for an entry, instead of listing all of the changes containing a commit for the particular file and retrieving the last, we iterate commits from latest to earliest, and as soon as we find a hash difference for the particular file we know that that is the latest commit. So we don't need to iterate over all repo commits.

We also now allow clients to pass in a full resource (branch, commit, dir or file) and we will return the list of commits that affect that particular entry.