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

Add binding for git_commit_body #835

Merged

Conversation

archer-321
Copy link
Contributor

This pull request adds a binding for git_commit_body.
While users could previously retrieve the commit body as part of the commit message, they would have to reimplement libgit2's functionality to extract the body paragraphs.
In addition to the new binding, I also updated the test suite to test a commit with a body paragraph instead.

The data users can get with the new binding is useful when displaying the title and body parts of a commit message differently. My use case for this feature is validating the commit body with a separate set of rules in a commit message linter I'm writing.

Thank you for the review in advance!

This patch adds a binding for git_commit_body to retrieve the commit
message without the summary paragraph. Additionally, this patch updates
the test suite to test commits with a body paragraph.

While the commit body was previously available via Commit::message,
users would have to reimplement libgit2's behaviour to extract the
commit body from it.
@joshtriplett joshtriplett merged commit 31d3ff0 into rust-lang:master May 1, 2022
@archer-321 archer-321 deleted the feature/git_commit_body-binding branch May 3, 2022 14:01
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