Skip to content

Add binding for git_commit_body#835

Merged
joshtriplett merged 1 commit intorust-lang:masterfrom
archer-321:feature/git_commit_body-binding
May 1, 2022
Merged

Add binding for git_commit_body#835
joshtriplett merged 1 commit intorust-lang:masterfrom
archer-321:feature/git_commit_body-binding

Conversation

@archer-321
Copy link
Copy Markdown
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