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

various improvements #1520

Merged
merged 14 commits into from
Aug 21, 2024
Merged

various improvements #1520

merged 14 commits into from
Aug 21, 2024

Conversation

Byron
Copy link
Member

@Byron Byron commented Aug 13, 2024

Various API changes to make diffing between trees and stats-retrieval less cumbersome.
Additionally, add more methods to make API more similar to git2 where it's clearly for convenience.

Related to gitbutlerapp/gitbutler#4670 .

Tasks

  • more convenience methods
  • more convenience around tree diffing and stats

@Byron Byron force-pushed the improvements branch 2 times, most recently from 0f4f75b to 4eed4c2 Compare August 13, 2024 17:58
@Byron
Copy link
Member Author

Byron commented Aug 13, 2024

@Jake-Shadle Would you be interested in adding libz-ng sans cmake to flate2? I have a feeling it's not straightforward though, but having it there under an equally unstable feature toggle would definitely help spread the goodness, I think.

@Jake-Shadle
Copy link
Contributor

Why would it not be straightforward?

@Byron
Copy link
Member Author

Byron commented Aug 13, 2024

flate2 uses the libz-ng-sys crate, which is a separate publish without the special feature. Probably there is a good reason for it. Then it might be required to work with all features still, so as always with cargo features, it's probably more finicky than one anticipates.

Your optimism is encouraging though.

@Byron Byron force-pushed the improvements branch 2 times, most recently from d74833b to a6da915 Compare August 20, 2024 21:12
Byron added 5 commits August 21, 2024 10:37
This also renames `TargetRef::Peeled` to `TargetRef::Object` to make clear
that it's not necessarily the peeled object that is contained.

Previously these terms were confusing due to the incorrect usage of the
word `peeled`.
The missing link that makes it possible to follow to the first object
and then peel the object according to any preferred algorithm.
Make it easy to follow a ref and peel it to a given object type.
Additional `peel_to_<kind>()` shortcuts are also provided, with
the same name as in `git2`.
Byron added 3 commits August 21, 2024 11:06
It's an equivalent to `git2::Reference::resolve()`.`
This works by providing `Change::detach()` and `ChangeDetached::attach()`.
Byron added 3 commits August 21, 2024 16:09
…diff-stats.

This function is inspired by `git2` which also makes it very simple to obtain.
It allows to keep a free-list of buffers around after clearing, to help
prevent re-allocating and growing bufers over and over.
@Byron Byron merged commit 242fedc into main Aug 21, 2024
19 checks passed
@Byron Byron deleted the improvements branch August 21, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants