Skip to content

Unable to specify lines of context while doing diff (-U flag) #1883

@bentotten

Description

@bentotten

Currently there does not appear to be a way to specify the lines of context desired while using the git function

For example:
git diff -U0 efefe435

It would be useful to add this to the api so that this command could be executed:
diff = commit.diff(parent, create_patch=True, lines_of_context=0)

In this function, lines_of_context could be added to the function:

**kwargs: Any,

and treated the same as the create_patch variable:

if create_patch:

args.append(f"-U{lines_of_context}")

Is this something that could be added?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions