Skip to content

Is there a way to retrieve the entire patch from a Commit object in PyDriller? #226

@workworkwc3

Description

@workworkwc3

Hi PyDriller team, thanks for your great package. I am wondering if there is currently a way to retrieve the entire patch string from a Commit object in PyDriller?

My team currently has a use case where we would like to store several artefacts from a commit into our database, including the full patch, in case we want to do our own custom parsing or processing. Reading the most recent version of the docs, I don't think this is currently possible (and honestly when I consider the main point of PyDriller, which IMO is to parse and process the patch info for us, it kind of makes sense that this might not be available). However as we are already using PyDriller, and we are assuming the package must be obtaining and maybe storing the entire patch in some way or another, I'm wondering if there is an some way we can get it from a Commit object, like "commit.patch". I know we can retrieve it using the Git API, or even scraping it from a URL such as "https://github.com/ishepard/pydriller/commit/250391839afcad3320e451c841090ccc69407e94.patch", but it would make it easier to just get it from PyDriller somehow. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR welcomeIssue is confirmed, but not fixed yetenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions