Skip to content

git-repository diff API #535

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

Merged
merged 48 commits into from
Sep 20, 2022
Merged

git-repository diff API #535

merged 48 commits into from
Sep 20, 2022

Conversation

Byron
Copy link
Member

@Byron Byron commented Sep 19, 2022

Now that it becomes clearer what to expect from diffing, we can go ahead and provide a high-level
API that can be used by crates-index-diff and by ein tool hours as well.

It should provide basic integration with git-diff, which for now is probably now more than a
type-based wrapper for similar.

Tasks

  • High-level API in git-repository
  • ability to diff two files via git-diff and Myers algorithm
  • upgrade crates-index-diff to that version of git-repository, for now in a branch
  • add ein tool hours --stats to get line-stats per author
  • percentages for lines and files
  • new release for crates-index-diff to use and new release of the latter.
  • basic tests for new functionality
  • make path component iteration easier for lookup_path().

Out of scope

  • rename tracking

@Byron Byron mentioned this pull request Sep 19, 2022
60 tasks
…#470)

Even though the empty-tree object can be found when searched via
`Repository::find_object()`, previously it was not locatable when
used during rev-spec parsing.
…e. (#470)

This is a first and maybe the last step towards providing diffing
functionality, and it seems like the right choice to keep this in
similar and contribute there as needed. All algorithms are well
described and thus shouldn't be git-specific per-se, and `similar`
is the best the community has to offer.
…mmit ancestor iteration. (#470)

This is useful to avoid additional lookups of the same object for
reading additional data from it.

Currently one needs an object cache to avoid duplciate object extraction
work, with such a cache being slower than accessing the same buffer
again.
…ut consumption. (#470)

This is useful if these provide additional out-of-band information.
…thor. (#470)

Note that these are expensive and unconditionally use threads to speed
up these computations.
This allows path conversions there to be just as efficient as on unix.

This was adopted from [a PR in the
hexlix-editor](https://github.com/helix-editor/helix/pull/3890/files#diff-504515b66023120e75a921cd56a932aed76c0ff62593fbb69d92e0ef65089501R47).
The disadvantage of doing that is that we copy the name, which
allocates, instead of just returning it by reference.
It's very common to try to work with trees, so let's make that easier.
But for some reason, the counter stays at 0 despite sharing the counter
stat.
Finally, issues due to bugs in prodash.
Even though failing is cheap, it's not free and can be done a million
times.
…line-stats`. (#470)

That way more information is generated at increasingly high costs.
…). (#470)

We assume unguessable ones are a plain text file, like one without
extension.
…actor v0.12.0, git-glob v0.4.0, git-path v0.5.0, git-quote v0.3.0, git-attributes v0.4.0, git-config-value v0.8.0, git-tempfile v2.0.5, git-validate v0.6.0, git-object v0.21.0, git-ref v0.16.0, git-sec v0.4.0, git-config v0.8.0, git-discover v0.5.0, git-traverse v0.17.0, git-index v0.5.0, git-worktree v0.5.0, git-testtools v0.9.0, git-command v0.1.0, git-prompt v0.1.0, git-url v0.9.0, git-credentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-chunk v0.3.2, git-pack v0.23.0, git-odb v0.33.0, git-packetline v0.13.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, git-commitgraph v0.9.0, gitoxide-core v0.18.0, gitoxide v0.16.0, safety bump 28 crates

SAFETY BUMP: git-actor v0.12.0, git-attributes v0.4.0, git-config-value v0.8.0, git-object v0.21.0, git-ref v0.16.0, git-sec v0.4.0, git-config v0.8.0, git-discover v0.5.0, git-traverse v0.17.0, git-index v0.5.0, git-worktree v0.5.0, git-testtools v0.9.0, git-command v0.1.0, git-prompt v0.1.0, git-url v0.9.0, git-credentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-pack v0.23.0, git-odb v0.33.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, gitoxide-core v0.18.0, gitoxide v0.16.0, git-pathspec v0.1.0
…edentials v0.5.0, git-diff v0.19.0, git-mailmap v0.4.0, git-chunk v0.3.2, git-pack v0.23.0, git-odb v0.33.0, git-packetline v0.13.0, git-transport v0.20.0, git-protocol v0.20.0, git-revision v0.5.0, git-refspec v0.2.0, git-repository v0.24.0, git-commitgraph v0.9.0, gitoxide-core v0.18.0, gitoxide v0.16.0
@Byron Byron merged commit f5c36d8 into main Sep 20, 2022
@Byron Byron deleted the diff branch September 20, 2022 10:51
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.

1 participant