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

Implement file history walk in revwalk #889

Merged
merged 6 commits into from Feb 4, 2016
Merged

Implement file history walk in revwalk #889

merged 6 commits into from Feb 4, 2016

Conversation

implausible
Copy link
Member

Implementing file history walk for revwalk. You pass it a sha, it then traverses until it either finds the 'added' entry for the file OR it hits the max number of commits to search for history.

@johnhaley81
Copy link
Collaborator

@implausible implausible changed the title [WIP] Implement file history walk in revwalk Implement file history walk in revwalk Feb 3, 2016
@implausible
Copy link
Member Author

@tbranyen @johnhaley81 once we get this to pass without some random test timing out, this is ready to go by my account. If you guys wanted to give this the once over before I merge in, that would be greatly appreciated.

Notes of interest: The fileHistoryWalk will do a rename detection if it discovers a file was added in the history and will return the old file name and the renamed status along with the commit. This helps history users to not only follow the filepath's history, but also see how the content if the file has changed / branched.

break;
}

git_diff *diffs;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't see these getting freed anywhere. Is this memory cleaned up?

Copy link
Member Author

Choose a reason for hiding this comment

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

I can't find whether or not we're supposed to clean it up or not. It would be super helpful if the docs gave me some insight

Copy link
Member Author

Choose a reason for hiding this comment

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

If you know explicitly that we're supposed to clean those up, I'll free the. I've been mulling it over myself, because the docs are not clear!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

oh cool! I guess since it's explained there they don't have to explain it in the function documentation for tree to tree.

@johnhaley81
Copy link
Collaborator

Other then the potential memory leak above, could you get some comment blocks into lib/revwalk/js for docs?

Only find similar if there is an added entry
Free diffs when we are done with them.
}
}

git_diff_free(diffs);
Copy link
Member Author

Choose a reason for hiding this comment

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

Freeing diffs down here now.

@implausible
Copy link
Member Author

@johnhaley81 @tbranyen what is going on with this test? https://travis-ci.org/nodegit/nodegit/jobs/106996362

johnhaley81 added a commit that referenced this pull request Feb 4, 2016
Implement file history walk in revwalk
@johnhaley81 johnhaley81 merged commit 2fca86e into master Feb 4, 2016
@johnhaley81 johnhaley81 deleted the file-history branch February 4, 2016 20:23
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.

None yet

2 participants