Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oxidize git-cliff #1554

Open
4 tasks done
Byron opened this issue Aug 25, 2024 · 6 comments
Open
4 tasks done

Oxidize git-cliff #1554

Byron opened this issue Aug 25, 2024 · 6 comments
Labels
C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide

Comments

@Byron
Copy link
Member

Byron commented Aug 25, 2024

  • walk commit graph topo + time sorted
  • extract commit information
  • walk tags and resolve them
  • filter by changes to a particular path

https://github.com/orhun/git-cliff

@Byron Byron changed the title Oxidize **git-cliff** Oxidize git-cliff Aug 25, 2024
@Byron Byron added the C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide label Aug 25, 2024
@Byron
Copy link
Member Author

Byron commented Aug 25, 2024

@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.

@orhun
Copy link

orhun commented Aug 25, 2024

Thanks for the update! I will let you know for sure.

I just need to find some time to make the switch.

Details

image

@txtsd
Copy link

txtsd commented Oct 27, 2024

@orhun Gentle nudge~

@orhun
Copy link

orhun commented Nov 13, 2024

I will be looking into Gitoxide on livestream today.

@orhun
Copy link

orhun commented Nov 14, 2024

Here is my takeaway from the stream:

  • libgit2 is being used in the repo.rs module which is responsible for handling the Git operations. Here is the docs.
  • In the stream, I added gix as 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 use gix (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-cliff I simply learned git2 from their examples.

I would appreciate some comments/help here :)

@Byron
Copy link
Member Author

Byron commented Nov 14, 2024

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() is Repository::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, and Diff makes them feel uniform, something that gix doesn'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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-integrate-gitoxide "Oxidize" crates even more by replacing git2 with gitoxide
Projects
None yet
Development

No branches or pull requests

3 participants