Oxidize `git-cliff`
- [x] walk commit graph topo + time sorted
- [x] extract commit information
- [x] walk tags and resolve them
- [x] filter by changes to a particular path
https://github.com/orhun/git-cliff
@orhun This analysis is quite old and might not be accurate anymore. But if it is, then moving it to gitoxide should give a performance boost, along with easier parallelization for even more performance.
And if something is missing, please let me know and I will update the description accordingly.
Thanks for the update! I will let you know for sure.
I just need to find some time to make the switch.
Details
@orhun Gentle nudge~
I will be looking into Gitoxide on livestream today.
Here is my takeaway from the stream:
libgit2is being used in therepo.rsmodule which is responsible for handling the Git operations. Here is the docs.- In the stream, I added
gixas a dependency and tried to adopt it in that module by replacing the usage. I still need to figure out a more lightweight way to usegix(i.e. without all the features). I'm open to suggestions there. - I could not find the equivalent of these functions in
gix: - For the other parts I can probably take a look at the examples and figure them out. Speaking of examples, I would really appreciate more. While implementing
git-cliffI simply learnedgit2from their examples.
I would appreciate some comments/help here :)
Thanks for sharing your experiences! Unfortunately it's expected to be somewhat rough at the moment. Searching by term in the gix docs on docs.rs is the way to go though, as I specifically add git2 search terms to map them to their gix counterparts.
- For repository-describe, there is
Commit::describe(). - Repository::graph_descendant_of isn't implemented, even though it will happen at some point as yet another graph traversal algorithm.
Repository::tag_names()isRepository::references()?.tags()?Diff::deltas()- it depends what is being diffed, as there is no general data structure for this (maybe 'yet'). There are various diffs between different aspects of a Git repository, andDiffmakes them feel uniform, something thatgixdoesn't do to expose all the differences between these diffs as well, for better or worse.
For discoverability, the gix docs are the most usable now due to these mappings from git2 to gix, done with doc-aliases.
Exhaustive examples may happen later, probably, as gix pushes for 1.0. It's still some way to go until there and you are definitely an early adopter. Especially due to all the breaking changes that probably happen till then, even though I am mindful about it.
I hope that helps - Diff::deltas I can say more about… after following the repo.rs link I can tell it's between trees, so Repository::diff_tree_to_tree() would be the way to get the Change::location().
Now I hope this helps.