You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#588 is a simmilar issue to this one but it just requests a way to get the latest commit but i want to get the latest commit for a specific branch. I already know that revwalk is the way to go but i don't really have other ideas.
The text was updated successfully, but these errors were encountered:
This seems like more of an implementation issue than a library issue.
This being said here is how I would approach this.
Get the newest commit.
Look for the file through the trees and find the OID (the sha1 hash of the file)
Go to the previous commit
Find the file again
See if the OID changed
Repeat 3,4 and 5 until the file doesn't exist or the OID is different.
Profit?
Because trees also have OIDs you can also do some caching to get some okay performance but this algorithm isn't very intensive.
You can also do things like making sure branches work correctly as well as looking in other directories for your file but this depends on your needs.
#588 is a simmilar issue to this one but it just requests a way to get the latest commit but i want to get the latest commit for a specific branch. I already know that revwalk is the way to go but i don't really have other ideas.
The text was updated successfully, but these errors were encountered: