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

remove git2go dependency #1001

Closed
wants to merge 1 commit into from
Closed

remove git2go dependency #1001

wants to merge 1 commit into from

Conversation

matthyx
Copy link
Contributor

@matthyx matthyx commented Jan 3, 2023

Describe your changes

Remove git2go dependency and replace functionalities with go-git.

Screenshots - If Any (Optional)

This PR fixes:

  • Resolved #

Checklist before requesting a review

  • My code follows the style guidelines of this project
  • I have commented on my code, particularly in hard-to-understand areas
  • I have performed a self-review of my code
  • If it is a core feature, I have added thorough tests.
  • New and existing unit tests pass locally with my changes

Please open the PR against the dev branch (Unless the PR contains only documentation changes)

@matthyx matthyx requested a review from dwertent January 3, 2023 14:12
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Welcome to Kubescape. Thank you for taking the time and contributing to the open source community

We will try to review as soon as possible!

@matthyx
Copy link
Contributor Author

matthyx commented Jan 3, 2023

I still need to edit README

@dwertent
Copy link
Contributor

dwertent commented Jan 3, 2023

cc: @amirmalka

@matthyx
Copy link
Contributor Author

matthyx commented Jan 3, 2023

Don't merge it as is, we have perf regression.

@dwertent dwertent marked this pull request as draft January 4, 2023 07:47
var allCommits []*git2go.Commit
err := logItr.Iterate(func(commit *git2go.Commit) bool {
var allCommits []*objectv5.Commit
err = logItr.ForEach(func(commit *objectv5.Commit) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthyx so if I understand correctly, this is the critical part that used to be slow (and might still be) and justified the use of the native git bindings? Is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the other comment

prevTree, err = prevCommit.Tree()
if err != nil {
continue
}
}

diff, err := g.git2GoRepo.DiffTreeToTree(prevTree, tree, nil)
changes, err := prevTree.Diff(tree)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the slow part... merkle tree diffs are painfully slow
I have tried to walk around with some commit.Files() to skip the tree diffs, but it's still slow to open blobs in order to get files changed.

@craigbox
Copy link
Contributor

craigbox commented Jan 9, 2023

I assume this fixes #832.

@craigbox craigbox linked an issue Jan 9, 2023 that may be closed by this pull request
@dwertent
Copy link
Contributor

Will not be merged as explained here.

@dwertent dwertent closed this Jan 11, 2023
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.

Build fails when vendoring
4 participants